|
| 1 | +--- |
| 2 | +repos: |
| 3 | + |
| 4 | + - repo: https://github.com/pre-commit/pre-commit-hooks |
| 5 | + rev: v5.0.0 |
| 6 | + hooks: |
| 7 | + - id: check-merge-conflict |
| 8 | + - id: check-added-large-files |
| 9 | + args: [--maxkb=500] |
| 10 | + - id: trailing-whitespace |
| 11 | + - id: detect-private-key |
| 12 | + - id: end-of-file-fixer |
| 13 | + - id: fix-encoding-pragma |
| 14 | + - id: file-contents-sorter |
| 15 | + files: ^(requirements.*\.txt|\.gitignore)$ |
| 16 | + - id: check-case-conflict |
| 17 | + - id: mixed-line-ending |
| 18 | + args: [--fix=lf] |
| 19 | + # ----------------------------- |
| 20 | + # Checkov is a static code analysis tool for scanning infrastructure as code (IaC) files for misconfigurations |
| 21 | + # that may lead to security or compliance problems. |
| 22 | + # ----------------------------- |
| 23 | + # Checkov includes more than 750 predefined policies to check for common misconfiguration issues. |
| 24 | + # Checkov also supports the creation and contribution of custom policies. |
| 25 | + # ----------------------------- |
| 26 | + # - repo: https://github.com/bridgecrewio/checkov.git |
| 27 | + # rev: 3.2.174 |
| 28 | + # hooks: |
| 29 | + # - id: checkov |
| 30 | + |
| 31 | + # ----------------------------- |
| 32 | + # Python Code Formatting with Black |
| 33 | + # ----------------------------- |
| 34 | + - repo: https://github.com/psf/black |
| 35 | + rev: 25.1.0 |
| 36 | + hooks: |
| 37 | + - id: black |
| 38 | + language_version: python3 |
| 39 | + files: \.py$ |
| 40 | + args: [--config=pyproject.toml] |
| 41 | + |
| 42 | + # ----------------------------- |
| 43 | + # Python Import Sorting with isort (complements Black) |
| 44 | + # ----------------------------- |
| 45 | + - repo: https://github.com/pycqa/isort |
| 46 | + rev: 6.0.1 |
| 47 | + hooks: |
| 48 | + - id: isort |
| 49 | + files: \.py$ |
| 50 | + args: [--profile=black, --line-length=88] |
| 51 | + |
| 52 | + # ----------------------------- |
| 53 | + # Python Code Quality with Pylint |
| 54 | + # ----------------------------- |
| 55 | + - repo: https://github.com/pycqa/pylint |
| 56 | + rev: v3.3.7 |
| 57 | + hooks: |
| 58 | + - id: pylint |
| 59 | + args: [--rcfile=pyproject.toml] |
| 60 | + files: \.py$ |
| 61 | + additional_dependencies: [PyJWT, requests, toml, colorama, setuptools] |
| 62 | + |
| 63 | + # ----------------------------- |
| 64 | + # Gitleaks SAST tool for detecting and preventing hardcoded secrets like passwords, api keys, and tokens in git repos |
| 65 | + # ----------------------------- |
| 66 | + # If you are knowingly committing something that is not a secret and gitleaks is catching it, |
| 67 | + # you can add an inline comment of '# gitleaks:allow' to the end of that line in your file. |
| 68 | + # This will instructs gitleaks to ignore that secret - example: |
| 69 | + # some_non_secret_value = a1b2c3d4e5f6g7h8i9j0 # gitleaks:allow |
| 70 | + # ----------------------------- |
| 71 | + - repo: https://github.com/gitleaks/gitleaks |
| 72 | + rev: v8.27.2 |
| 73 | + hooks: |
| 74 | + - id: gitleaks |
| 75 | + args: ['--config=.gitleaks.toml'] |
| 76 | + # ----------------------------- |
| 77 | + # # Generates Table of Contents in Markdown files |
| 78 | + # # ----------------------------- |
| 79 | + - repo: https://github.com/frnmst/md-toc |
| 80 | + rev: 9.0.0 |
| 81 | + hooks: |
| 82 | + - id: md-toc |
| 83 | + args: [-p, github] # CLI options |
| 84 | + # ----------------------------- |
| 85 | + # YAML Linting on yaml files for pre-commit and github actions |
| 86 | + # ----------------------------- |
| 87 | + - repo: https://github.com/adrienverge/yamllint |
| 88 | + rev: v1.37.1 |
| 89 | + hooks: |
| 90 | + - id: yamllint |
| 91 | + name: Check YAML syntax with yamllint |
| 92 | + args: [--strict, -c=.yamllint.yaml, '.'] |
| 93 | + always_run: true |
| 94 | + pass_filenames: true |
| 95 | + |
| 96 | + # ----------------------------- |
| 97 | + # GitHub Actions Workflow Linting on .github/workflows/*.yml files |
| 98 | + # ----------------------------- |
| 99 | + - repo: https://github.com/rhysd/actionlint |
| 100 | + rev: v1.7.7 |
| 101 | + hooks: |
| 102 | + - id: actionlint |
| 103 | + |
| 104 | + - repo: local |
| 105 | + hooks: |
| 106 | + - id: toml build |
| 107 | + name: test the .toml package health |
| 108 | + entry: pip3 install . |
| 109 | + language: python |
| 110 | + pass_filenames: false |
| 111 | + always_run: true |
0 commit comments