-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace some checks by pre commits hooks
To use more standards tools
- Loading branch information
Showing
37 changed files
with
637 additions
and
2,180 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash -eux | ||
|
||
pip install --requirement=requirements.txt | ||
make jsonschema | ||
|
||
for f in config.md applications.md; do | ||
for c in trailing-whitespace prettier; do | ||
pre-commit run --files=$f $c > /dev/null || true | ||
done | ||
done | ||
for f in c2cciutils/configuration.py c2cciutils/applications_definition.py; do | ||
for c in black isort pyupgrade; do | ||
pre-commit run --files=$f $c > /dev/null || true | ||
done | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
repos: | ||
- repo: local | ||
hooks: | ||
- id: jsonschema | ||
name: jsonschema | ||
language: python | ||
files: ^c2cciutils/schema.*\.json$ | ||
types: | ||
- json | ||
pass_filenames: false | ||
entry: .github/jsonschema-precommit | ||
- id: check-poetry | ||
name: poetry check | ||
description: Validates the structure of the pyproject.toml file | ||
entry: poetry check | ||
language: python | ||
additional_dependencies: | ||
- poetry==1.2.1 | ||
pass_filenames: false | ||
files: ^pyproject\.toml$ | ||
- id: lock-poetry | ||
name: poetry lock | ||
description: Lock the from the pyproject.toml file | ||
entry: poetry lock --no-update | ||
language: python | ||
additional_dependencies: | ||
- poetry==1.2.1 | ||
pass_filenames: false | ||
files: ^pyproject\.toml$ | ||
- 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/pre-commit-copyright | ||
rev: 0.1.4 | ||
hooks: | ||
- id: copyright | ||
- repo: https://github.com/codespell-project/codespell | ||
rev: v2.2.2 | ||
hooks: | ||
- id: codespell | ||
exclude: ^(.*/)?poetry\.lock$ | ||
- repo: https://github.com/pre-commit/mirrors-prettier | ||
rev: v2.7.1 | ||
hooks: | ||
- id: prettier | ||
additional_dependencies: | ||
- prettier@2.8.1 # npm | ||
- prettier-plugin-sh@0.12.8 # npm | ||
- prettier-plugin-toml@0.3.1 # npm | ||
- '@prettier/plugin-xml@0.12.0' # npm | ||
- 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-workflows | ||
- 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/psf/black | ||
rev: 22.12.0 | ||
hooks: | ||
- id: black | ||
- repo: https://github.com/PyCQA/isort | ||
rev: 5.11.4 | ||
hooks: | ||
- id: isort | ||
- 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/prospector | ||
rev: v1.8.4 | ||
hooks: | ||
- id: prospector | ||
args: | ||
- --tool=pydocstyle | ||
- --die-on-tool-error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
- id: workflows-require-timeout | ||
name: workflows require timeout | ||
description: Check that the workflows have a timeout | ||
entry: c2cciutils-checks | ||
args: | ||
- --check=workflow | ||
files: ^\.github/workflows/.+\.ya?ml$ | ||
language: python | ||
- id: check-poetry | ||
name: poetry check | ||
description: Validates the structure of the pyproject.toml file | ||
entry: poetry check | ||
language: python | ||
additional_dependencies: | ||
- poetry | ||
pass_filenames: false | ||
files: ^pyproject\.toml$ | ||
- id: lock-poetry | ||
name: poetry lock | ||
description: Lock the from the pyproject.toml file | ||
entry: poetry lock | ||
args: | ||
- --no-update | ||
language: python | ||
additional_dependencies: | ||
- poetry | ||
pass_filenames: false | ||
files: ^pyproject\.toml$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.