mirror of
https://github.com/Horizontal42/netsleuth.git
synced 2026-11-11 01:02:10 +03:00
ci: add pre-commit hooks for linting, security scanning, and secret detection
This commit is contained in:
parent
e4778f6298
commit
df4336a912
1 changed files with 40 additions and 0 deletions
40
.pre-commit-config.yaml
Normal file
40
.pre-commit-config.yaml
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
# See https://pre-commit.com for more information
|
||||||
|
# See https://pre-commit.com/hooks.html for more hooks
|
||||||
|
repos:
|
||||||
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
|
rev: v5.0.0
|
||||||
|
hooks:
|
||||||
|
- id: trailing-whitespace
|
||||||
|
- id: end-of-file-fixer
|
||||||
|
- id: check-yaml
|
||||||
|
args: ['--unsafe']
|
||||||
|
- id: check-json
|
||||||
|
- id: check-added-large-files
|
||||||
|
args: ['--maxkb=1024']
|
||||||
|
- id: detect-private-key
|
||||||
|
- id: detect-aws-credentials
|
||||||
|
args: ['--allow-missing-credentials']
|
||||||
|
|
||||||
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||||
|
rev: v0.11.0
|
||||||
|
hooks:
|
||||||
|
- id: ruff
|
||||||
|
args: [--fix, --exit-non-zero-on-fix]
|
||||||
|
- id: ruff-format
|
||||||
|
|
||||||
|
- repo: https://github.com/PyCQA/bandit
|
||||||
|
rev: 1.8.3
|
||||||
|
hooks:
|
||||||
|
- id: bandit
|
||||||
|
args: ['-r', '-ll', '-ii']
|
||||||
|
additional_dependencies: ["bandit[toml]"]
|
||||||
|
|
||||||
|
- repo: local
|
||||||
|
hooks:
|
||||||
|
- id: pytest-check
|
||||||
|
name: Run pytest smoke tests
|
||||||
|
entry: uv run pytest -q --tb=short
|
||||||
|
language: system
|
||||||
|
pass_filenames: false
|
||||||
|
always_run: true
|
||||||
|
stages: [pre-push]
|
||||||
Loading…
Add table
Reference in a new issue