-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.pre-commit-config.yaml
64 lines (64 loc) · 2.53 KB
/
.pre-commit-config.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
repos:
- repo: local
hooks:
# This hook checks for secrets in the repository. If you are committing secrets or keys, it won't let you commit your stuff.
- id: trufflehog
name: TruffleHog
description: Detect secrets in your data.
entry: bash -c 'docker run -v "$(pwd):/workdir" --rm trufflesecurity/trufflehog:latest git file:///workdir --exclude_paths /workdir/.trufflehogignore'
language: system
stages: ["commit", "push"]
# This one is to check if the commit message follows the conventional commit standard. https://www.conventionalcommits.org/en/v1.0.0/
# It will check if the commit message starts with "feat", "fix", "chore", "test" or "custom". You must follow the pattern.
- repo: https://github.com/compilerla/conventional-pre-commit
rev: v3.2.0
hooks:
- id: conventional-pre-commit
stages: [commit-msg]
args: [--strict, --force-scope, feat, fix, chore, test, custom]
# This one checks if the code is formatted according to the black standard. https://black.readthedocs.io/en/stable/
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.3.5
hooks:
# Run the linter.
- id: ruff
args: [ --fix , --exclude, packages ]
# Run the formatter.
- id: ruff-format
# This ones checks all the basic stuff. Like trailing whitespaces, end of file, yaml syntax, debug statements, etc.
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: debug-statements
#- id: double-quote-string-fixer
- id: name-tests-test
- id: requirements-txt-fixer
- repo: https://github.com/asottile/add-trailing-comma
rev: v3.1.0
hooks:
- id: add-trailing-comma
# This one helps you to upgrade your python code to the latest version. It will upgrade your code to the latest version of python.
# It's useful when you are using old code from tutorials or old projects. It will help you to keep your code up to date.
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.2
hooks:
- id: pyupgrade
args: [--py311-plus]
# This one checks the Dockerfile for security vulnerabilities. It uses Trivy to check the Dockerfile.
- repo: https://github.com/mxab/pre-commit-trivy.git
rev: v0.12.0
hooks:
- id: trivyfs-docker
args:
- --skip-dirs
- ./tests,./confs
- .
- id: trivyconfig-docker
args:
- --skip-dirs
- ./tests,./confs
- .