Skip to content

Commit

Permalink
Add pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
fizyk committed Feb 4, 2025
1 parent 93bd083 commit 0ace962
Show file tree
Hide file tree
Showing 10 changed files with 102 additions and 53 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ Chore that needs to be done:

* [ ] Add newsfragment `pipenv run towncrier create [issue_number].[type].rst`

Types are defined in the pyproject.toml, issue_numer either from issue tracker or the Pull request number
Types are defined in the pyproject.toml, issue_numer either from issue tracker or the Pull request number
18 changes: 18 additions & 0 deletions .github/workflows/automerge-shared.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,21 @@ jobs:
MERGE_METHOD: MERGE
PRESET: DEPENDABOT_MINOR
ENABLED_FOR_MANUAL_CHANGES: 'true'
- name: Merge me!
uses: ridedott/[email protected]
with:
# Depending on branch protection rules, a manually populated
# `GITHUB_TOKEN_WORKAROUND` secret with permissions to push to
# a protected branch must be used. This secret can have an arbitrary
# name, as an example, this repository uses `DOTTBOTT_TOKEN`.
#
# When using a custom token, it is recommended to leave the following
# comment for other developers to be aware of the reasoning behind it:
#
# This must be used as GitHub Actions token does not support pushing
# to protected branches.
GITHUB_LOGIN: pre-commit-ci
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
MERGE_METHOD: MERGE
PRESET: DEPENDABOT_MINOR
ENABLED_FOR_MANUAL_CHANGES: 'true'
2 changes: 1 addition & 1 deletion .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Check out repository
uses: actions/checkout@v4
- uses: ./.github/actions/pipenv
if: ${{ github.actor != 'dependabot[bot]' }}
if: ${{ !contains(fromJSON('["dependabot[bot]","pre-commit-ci[bot]"]'), github.actor) }}
with:
python-version: "3.13"
command: towncrier check --compare-with origin/main
Expand Down
26 changes: 26 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---

# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
minimum_pre_commit_version: 4.0.0
default_stages: [pre-commit]
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-merge-conflict
- id: trailing-whitespace
- id: check-toml
- id: end-of-file-fixer
- id: mixed-line-ending
- id: check-yaml
- id: pretty-format-json
- id: detect-private-key

- repo: https://github.com/rstcheck/rstcheck
rev: v6.2.4
hooks:
- id: rstcheck
additional_dependencies: [sphinx, toml]
2 changes: 2 additions & 0 deletions .rstcheck.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[rstcheck]
report_level = warning
76 changes: 38 additions & 38 deletions Changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Features
Misc
----

- `#173 <https:/github.com/fizyk/actions-reuse/issues/173>`_
- `#173 <https:/github.com/fizyk/actions-reuse/issues/173>`__


2.4.6 (2024-05-08)
Expand All @@ -52,7 +52,7 @@ Misc
Misc
----

- `#172 <https:/github.com/fizyk/actions-reuse/issues/172>`_
- `#172 <https:/github.com/fizyk/actions-reuse/issues/172>`__


2.4.5 (2024-05-08)
Expand All @@ -61,7 +61,7 @@ Misc
Misc
----

- `#171 <https:/github.com/fizyk/actions-reuse/issues/171>`_
- `#171 <https:/github.com/fizyk/actions-reuse/issues/171>`__


2.4.4 (2024-03-15)
Expand All @@ -70,7 +70,7 @@ Misc
Misc
----

- `#160 <https:/github.com/fizyk/actions-reuse/issues/160>`_
- `#160 <https:/github.com/fizyk/actions-reuse/issues/160>`__


2.4.3 (2024-03-15)
Expand All @@ -85,7 +85,7 @@ No significant changes.
Features
--------

- Ability to make caching optional (`#140 <https:/github.com/fizyk/actions-reuse/issues/140>`_)
- Ability to make caching optional (`#140 <https:/github.com/fizyk/actions-reuse/issues/140>`__)


2.4.1 (2023-10-23)
Expand All @@ -94,7 +94,7 @@ Features
Bugfixes
--------

- If PKG_CONFIG_PATH is set, then work around setup-python and extend it with original value. (`#139 <https:/github.com/fizyk/actions-reuse/issues/139>`_)
- If PKG_CONFIG_PATH is set, then work around setup-python and extend it with original value. (`#139 <https:/github.com/fizyk/actions-reuse/issues/139>`__)


2.4.0 (2023-10-03)
Expand All @@ -103,7 +103,7 @@ Bugfixes
Features
--------

- Use Python 3.12 by default, drop 3.7 for default set of python versions. (`#138 <https:/github.com/fizyk/actions-reuse/issues/138>`_)
- Use Python 3.12 by default, drop 3.7 for default set of python versions. (`#138 <https:/github.com/fizyk/actions-reuse/issues/138>`__)


2.3.2 (2023-09-11)
Expand All @@ -112,7 +112,7 @@ Features
Misc
----

- `#137 <https:/github.com/fizyk/actions-reuse/issues/137>`_
- `#137 <https:/github.com/fizyk/actions-reuse/issues/137>`__


2.3.1 (2023-09-08)
Expand All @@ -121,7 +121,7 @@ Misc
Bugfixes
--------

- fix pipenv caching - use Pipfile for dependency cache not Pipfile.lock which might not be present (`#133 <https:/github.com/fizyk/actions-reuse/issues/133>`_)
- fix pipenv caching - use Pipfile for dependency cache not Pipfile.lock which might not be present (`#133 <https:/github.com/fizyk/actions-reuse/issues/133>`__)


2.3.0 (2023-09-08)
Expand All @@ -130,11 +130,11 @@ Bugfixes
Features
--------

- Store Pipfile.lock as an artifact if it's not versioned. (`#128 <https:/github.com/fizyk/actions-reuse/issues/128>`_)
- Cache pipenv dependencies (`#129 <https:/github.com/fizyk/actions-reuse/issues/129>`_)
- Store Pipfile.lock as an artifact if it's not versioned. (`#128 <https:/github.com/fizyk/actions-reuse/issues/128>`__)
- Cache pipenv dependencies (`#129 <https:/github.com/fizyk/actions-reuse/issues/129>`__)
- Cache `Pipfile.lock` if it's not versioned in git -
this will help provide reproducible builds, and allows
to remove `--skip-lock` flags from pipenv install commands.. (`#129 <https:/github.com/fizyk/actions-reuse/issues/129>`_)
to remove `--skip-lock` flags from pipenv install commands.. (`#129 <https:/github.com/fizyk/actions-reuse/issues/129>`__)


2.2.1 (2023-07-12)
Expand All @@ -143,7 +143,7 @@ Features
Bugfixes
--------

- Trigger rstcheck on rstcheck flag not rst one. (`#123 <https:/github.com/fizyk/actions-reuse/issues/123>`_)
- Trigger rstcheck on rstcheck flag not rst one. (`#123 <https:/github.com/fizyk/actions-reuse/issues/123>`__)


2.2.0 (2023-07-12)
Expand All @@ -152,13 +152,13 @@ Bugfixes
Features
--------

- Added support for rstcheck rst linter (`#120 <https:/github.com/fizyk/actions-reuse/issues/120>`_)
- Added support for rstcheck rst linter (`#120 <https:/github.com/fizyk/actions-reuse/issues/120>`__)


Misc
----

- `#117 <https:/github.com/fizyk/actions-reuse/issues/117>`_
- `#117 <https:/github.com/fizyk/actions-reuse/issues/117>`__


2.1.2 (2023-05-20)
Expand All @@ -167,7 +167,7 @@ Misc
Deprecations and Removals
-------------------------

- Revert trusted publishers, it's still not supported for reusable workflows. (`#111 <https://github.com/fizyk/actions-reuse/issues/111>`_)
- Revert trusted publishers, it's still not supported for reusable workflows. (`#111 <https://github.com/fizyk/actions-reuse/issues/111>`__)


2.1.1 (2023-05-19)
Expand All @@ -176,7 +176,7 @@ Deprecations and Removals
Bugfixes
--------

- Removed unneeded secrets fro pypi workflow (`#110 <https://github.com/fizyk/actions-reuse/issues/110>`_)
- Removed unneeded secrets fro pypi workflow (`#110 <https://github.com/fizyk/actions-reuse/issues/110>`__)


2.1.0 (2023-05-19)
Expand All @@ -185,7 +185,7 @@ Bugfixes
Features
--------

- Migrate pypi workflow to trusted publishers (`#109 <https://github.com/fizyk/actions-reuse/issues/109>`_)
- Migrate pypi workflow to trusted publishers (`#109 <https://github.com/fizyk/actions-reuse/issues/109>`__)


2.0.0 (2023-05-16)
Expand All @@ -194,15 +194,15 @@ Features
Features
--------

- Added support to run ruff linter (`#97 <https://github.com/fizyk/actions-reuse/issues/97>`_)
- Have all linters turned off by default. Turning them on explicitly would be much more sane. (`#98 <https://github.com/fizyk/actions-reuse/issues/98>`_)
- Run all actions on pipenv by default instead of pip. (`#99 <https://github.com/fizyk/actions-reuse/issues/99>`_)
- Added support to run ruff linter (`#97 <https://github.com/fizyk/actions-reuse/issues/97>`__)
- Have all linters turned off by default. Turning them on explicitly would be much more sane. (`#98 <https://github.com/fizyk/actions-reuse/issues/98>`__)
- Run all actions on pipenv by default instead of pip. (`#99 <https://github.com/fizyk/actions-reuse/issues/99>`__)


Deprecations and Removals
-------------------------

- Removed pipenv option. Now pipenv is used by default and actions only fall back to pip if requirements file is being passed. (`#99 <https://github.com/fizyk/actions-reuse/issues/99>`_)
- Removed pipenv option. Now pipenv is used by default and actions only fall back to pip if requirements file is being passed. (`#99 <https://github.com/fizyk/actions-reuse/issues/99>`__)


1.7.1 (2023-03-06)
Expand All @@ -211,7 +211,7 @@ Deprecations and Removals
Bugfixes
--------

- Fix incorrect parameter type bool -> boolean (`#92 <https://github.com/fizyk/actions-reuse/issues/92>`_)
- Fix incorrect parameter type bool -> boolean (`#92 <https://github.com/fizyk/actions-reuse/issues/92>`__)


1.7.0 (2023-02-27)
Expand All @@ -220,8 +220,8 @@ Bugfixes
Features
--------

- Ability to store built package as pipeline artifacts. (`#90 <https://github.com/fizyk/actions-reuse/issues/90>`_)
- Be able to configure codecov's `fail_on_ci_error` - defaults to false. (`#91 <https://github.com/fizyk/actions-reuse/issues/91>`_)
- Ability to store built package as pipeline artifacts. (`#90 <https://github.com/fizyk/actions-reuse/issues/90>`__)
- Be able to configure codecov's `fail_on_ci_error` - defaults to false. (`#91 <https://github.com/fizyk/actions-reuse/issues/91>`__)


1.6.4 (2022-12-21)
Expand All @@ -230,7 +230,7 @@ Features
Features
--------

- Add your info here (`#85 <https://github.com/fizyk/actions-reuse/issues/85>`_)
- Add your info here (`#85 <https://github.com/fizyk/actions-reuse/issues/85>`__)


1.6.3 (2022-12-05)
Expand All @@ -239,7 +239,7 @@ Features
Features
--------

- Switch to build package building system (`#82 <https://github.com/fizyk/actions-reuse/issues/82>`_)
- Switch to build package building system (`#82 <https://github.com/fizyk/actions-reuse/issues/82>`__)


1.6.2 (2022-11-29)
Expand All @@ -248,13 +248,13 @@ Features
Bugfixes
--------

- Secrets have no type - fixed automerge-shared secrets definition. (`#79 <https://github.com/fizyk/actions-reuse/issues/79>`_)
- Secrets have no type - fixed automerge-shared secrets definition. (`#79 <https://github.com/fizyk/actions-reuse/issues/79>`__)


Misc
----

- `#78 <https://github.com/fizyk/actions-reuse/issues/78>`_
- `#78 <https://github.com/fizyk/actions-reuse/issues/78>`__


1.6.1 (2022-11-29)
Expand All @@ -263,7 +263,7 @@ Misc
Bugfixes
--------

- Add your info here (`#77 <https://github.com/fizyk/actions-reuse/issues/77>`_)
- Add your info here (`#77 <https://github.com/fizyk/actions-reuse/issues/77>`__)


1.6.0 (2022-11-29)
Expand All @@ -272,13 +272,13 @@ Bugfixes
Features
--------

- Add `automerge-shared` shared workflow to re-usable workflows. (`#76 <https://github.com/fizyk/actions-reuse/issues/76>`_)
- Add `automerge-shared` shared workflow to re-usable workflows. (`#76 <https://github.com/fizyk/actions-reuse/issues/76>`__)


Misc
----

- `#74 <https://github.com/fizyk/actions-reuse/issues/74>`_, `#75 <https://github.com/fizyk/actions-reuse/issues/75>`_
- `#74 <https://github.com/fizyk/actions-reuse/issues/74>`__, `#75 <https://github.com/fizyk/actions-reuse/issues/75>`__


1.5.2 (2022-11-25)
Expand All @@ -288,7 +288,7 @@ Features
--------

- Removed pylint-paths parameters and now running pylint with `pylint --recursive y .` command.
Any ignores can be set in .pylintrc file. (`#72 <https://github.com/fizyk/actions-reuse/issues/72>`_)
Any ignores can be set in .pylintrc file. (`#72 <https://github.com/fizyk/actions-reuse/issues/72>`__)


1.5.1 (2022-11-24)
Expand All @@ -297,7 +297,7 @@ Features
Bugfixes
--------

- Removed the ability to set up cover package's paths/names. use .coveragerc for that instead. (`#71 <https://github.com/fizyk/actions-reuse/issues/71>`_)
- Removed the ability to set up cover package's paths/names. use .coveragerc for that instead. (`#71 <https://github.com/fizyk/actions-reuse/issues/71>`__)


1.5.0 (2022-11-24)
Expand All @@ -306,13 +306,13 @@ Bugfixes
Features
--------

- Ability to set paths for linters (`#70 <https://github.com/fizyk/actions-reuse/issues/70>`_)
- Ability to set paths for linters (`#70 <https://github.com/fizyk/actions-reuse/issues/70>`__)


Misc
----

- `#68 <https://github.com/fizyk/actions-reuse/issues/68>`_, `#69 <https://github.com/fizyk/actions-reuse/issues/69>`_
- `#68 <https://github.com/fizyk/actions-reuse/issues/68>`__, `#69 <https://github.com/fizyk/actions-reuse/issues/69>`__


1.4.1 (2022-11-18)
Expand All @@ -322,7 +322,7 @@ Features
--------

- pipenv template, linters-python and tests-pytests accepts `pipenv-install-options`
for additional pipenv install options. Might allow adding ie. `--skip-lock`. (`#67 <https://github.com/fizyk/actions-reuse/issues/67>`_)
for additional pipenv install options. Might allow adding ie. `--skip-lock`. (`#67 <https://github.com/fizyk/actions-reuse/issues/67>`__)


1.4.0 (2022-11-08)
Expand All @@ -331,4 +331,4 @@ Features
Misc
----

- `#65 <https://github.com/fizyk/actions-reuse/issues/65>`_
- `#65 <https://github.com/fizyk/actions-reuse/issues/65>`__
Loading

0 comments on commit 0ace962

Please sign in to comment.