Skip to content

Commit

Permalink
Add/update pre-commit hooks
Browse files Browse the repository at this point in the history
Add/update pre-commit hooks generated by add-pre-commit-hooks command
  • Loading branch information
sbrunner committed Mar 23, 2023
1 parent b3da273 commit dc9b9ad
Show file tree
Hide file tree
Showing 7 changed files with 119 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@
schedule: 'after 5pm on the first day of the month',
},
baseBranches: ['master', '1.6', '1.8'],
'pre-commit': { enabled: true },
regexManagers: [
{
fileMatch: ['^.pre-commit-config.yaml$'],
matchStrings: [" +- '?(?<depName>[^' @=]+)(@|==)(?<currentValue>[^' @=]+)'? # (?<datasource>.+)"],
},
],
packageRules: [
/** Automerge the patch, the minor and the dev dependency */
{
Expand Down
File renamed without changes.
10 changes: 10 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,16 @@ jobs:
- run: echo "${HOME}/.local/bin" >> ${GITHUB_PATH}
- run: python3 -m pip install --user --requirement=ci/requirements.txt

- uses: actions/cache@v3
with:
path: ~/.cache/pre-commit
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
restore-keys: "pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}\npre-commit-"
- run: pre-commit run --all-files
env:
SKIP: poetry-lock
- run: git diff && false
if: failure()
- name: Checks
run: c2cciutils-checks

Expand Down
91 changes: 91 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,94 @@ repos:
- id: prettier
additional_dependencies:
- prettier@2.8.4
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: detect-private-key
- id: check-merge-conflict
- id: check-ast
- id: debug-statements
- id: check-toml
- id: check-yaml
- id: check-json
- id: end-of-file-fixer
- id: trailing-whitespace
- id: mixed-line-ending
- repo: https://github.com/sbrunner/hooks
rev: 0.3.2
hooks:
- id: copyright
- id: poetry-check
additional_dependencies:
- poetry==1.3.2 # pypi
- id: poetry-lock
additional_dependencies:
- poetry==1.3.2 # pypi
- repo: https://github.com/codespell-project/codespell
rev: v2.2.2
hooks:
- id: codespell
exclude: ^(.*/)?poetry\.lock$
args:
- --ignore-words=.github/spell-ignore-words.txt
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.9.0.2
hooks:
- id: shellcheck
- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: 3.0.0
hooks:
- id: git-check
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.20.0
hooks:
- id: check-github-actions
- id: check-github-workflows
- id: check-jsonschema
name: Check GitHub Workflows set timeout-minutes
files: ^\.github/workflows/[^/]+$
types:
- yaml
args:
- --builtin-schema
- github-workflows-require-timeout
- id: check-renovate
additional_dependencies:
- pyjson5==1.6.2 # pypi
- repo: https://github.com/sirwart/ripsecrets
rev: v0.1.5
hooks:
- id: ripsecrets
- repo: https://github.com/PyCQA/autoflake
rev: v2.0.0
hooks:
- id: autoflake
- repo: https://github.com/asottile/pyupgrade
rev: v3.3.1
hooks:
- id: pyupgrade
args:
- --py38-plus
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 22.12.0
hooks:
- id: black
- repo: https://github.com/PyCQA/prospector
rev: v1.8.4
hooks:
- id: prospector
args:
- --tool=pydocstyle
- --die-on-tool-error
- --output-format=pylint
ci:
autoupdate_schedule: quarterly
skip:
- copyright
- poetry-check
- poetry-lock
- ripsecrets
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -322,3 +322,12 @@ OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED O
DAMAGE.

vim: set filetype=rst spell spelllang=en textwidth=0:

## Contributing

Install the pre-commit hooks:

```bash
pip install pre-commit
pre-commit install --allow-missing-config
```
1 change: 1 addition & 0 deletions ci/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
checks:
versions: false

codespell: false
publish:
docker:
images: []
1 change: 1 addition & 0 deletions ci/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
c2cciutils[checks,publish]==1.5.0
pre-commit==2.21.0

0 comments on commit dc9b9ad

Please sign in to comment.