chore: updated pre-commit files

This commit is contained in:
Michele Cereda
2023-09-16 22:05:29 +02:00
parent 251673f58b
commit b422484133
3 changed files with 22 additions and 9 deletions

View File

@@ -30,7 +30,7 @@ repos:
# - repo: https://github.com/ansible-community/ansible-lint # - repo: https://github.com/ansible-community/ansible-lint
# # FIXME: need to figure this out, too many stupid issues. # # FIXME: need to figure this out, too many stupid issues.
# # Using `ansible-lint -v ansible` for the time being. # # Using `ansible-lint -v ansible` for the time being.
# rev: v6.15.0 # rev: v6.19.0
# hooks: # hooks:
# - id: ansible-lint # - id: ansible-lint
# exclude: .* # exclude: .*

View File

@@ -22,6 +22,7 @@
"clamav", "clamav",
"clamd", "clamd",
"clamscan", "clamscan",
"commitlint",
"compsize", "compsize",
"cowsay", "cowsay",
"cpulimit", "cpulimit",

View File

@@ -15,16 +15,17 @@ pre-commit sample-config > .pre-commit-config.yaml
# Manually run checks. # Manually run checks.
pre-commit run --all-files pre-commit run --all-files
pre-commit run ansible-lint --files ansible/ pre-commit run "ansible-lint" --files "ansible/"
# Automatically run checks at every commit. # Automatically run checks at every commit.
pre-commit install pre-commit install
# Update all hooks to the latest version. # Update all hooks to the latest version available.
# It is *not* always the latest *stable* release.
pre-commit autoupdate pre-commit autoupdate
# Skip check on commit. # Skip check on commit.
SKIP=flake8 git commit -m "foo" SKIP="flake8" git commit -m "foo"
``` ```
```yaml ```yaml
@@ -34,25 +35,36 @@ SKIP=flake8 git commit -m "foo"
# See https://pre-commit.com/hooks.html for more hooks # See https://pre-commit.com/hooks.html for more hooks
# See https://github.com/pre-commit/identify/blob/main/identify/extensions.py for the list of file types by extension # See https://github.com/pre-commit/identify/blob/main/identify/extensions.py for the list of file types by extension
exclude: ^FIXME/.*$ # ignore all files matching the regexp
fail_fast: true # stop at the first error
repos: repos:
- repo: https://github.com/pre-commit/pre-commit-hooks - repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0 rev: v4.4.0
hooks: hooks:
- id: check-added-large-files
- id: check-json
- id: check-yaml
args: [--allow-multiple-documents]
- id: check-xml
- id: trailing-whitespace - id: trailing-whitespace
args: args:
- --markdown-linebreak-ext=md # ignore markdown's line break - --markdown-linebreak-ext=md # ignore markdown's line break
- id: end-of-file-fixer - id: end-of-file-fixer
- id: check-yaml - repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
- id: check-added-large-files rev: v9.5.0
hooks:
- id: commitlint
stages: [commit-msg] # limit to specific stages
additional_dependencies: ['@commitlint/config-conventional']
- repo: https://github.com/markdownlint/markdownlint - repo: https://github.com/markdownlint/markdownlint
rev: v0.11.0 rev: v0.12.0
hooks: hooks:
- id: markdownlint - id: markdownlint
types: [markdown] # limit target types types: [markdown] # limit target types
args: args:
- -r "~MD013" # ignore line-length rule - -r "~MD013" # ignore line-length rule
- repo: https://github.com/ansible-community/ansible-lint - repo: https://github.com/ansible-community/ansible-lint
rev: v6.0.2 rev: v6.19.0
hooks: hooks:
- id: ansible-lint - id: ansible-lint
name: ansilint # use an alias name: ansilint # use an alias