Skip to content

Commit

Permalink
Add pre-commit hooks
Browse files Browse the repository at this point in the history
Add pre-commit hooks generated by add-pre-commit-hooks command
  • Loading branch information
sbrunner committed Mar 16, 2023
1 parent 818802d commit 25ec27d
Show file tree
Hide file tree
Showing 5 changed files with 101 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 @@ -15,6 +15,13 @@
kubernetes: {
fileMatch: ['templates/.+\\.yaml$', 'tests/.*expected\\.yaml$'],
},
'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
10 changes: 10 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,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: helm-lock
- run: git diff
if: failure()
- name: Checks
run: c2cciutils-checks

Expand Down
74 changes: 74 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
ci:
autoupdate_schedule: quarterly
skip:
- copyright
- helm-lock
- ripsecrets
repos:
- 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
exclude: ^templates/.+\.yaml$
args:
- --allow-multiple-documents
- 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: workflows-require-timeout
- id: helm-lock
- repo: https://github.com/codespell-project/codespell
rev: v2.2.2
hooks:
- id: codespell
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.7.1
hooks:
- id: prettier
additional_dependencies:
- [email protected] # npm
- [email protected] # npm
- [email protected] # npm
- '@prettier/[email protected]' # 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-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/gruntwork-io/pre-commit
rev: v0.1.17
hooks:
- id: helmlint
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,12 @@
With this chart you can easily deploy a simple custom application on Kubernetes, with only configuration.

[See as example](./tests/values.yaml).

## Contributing

Install the pre-commit hooks:

```bash
pip install pre-commit
pre-commit install --allow-missing-config
```
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 25ec27d

Please sign in to comment.