-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
89 lines (79 loc) · 2.55 KB
/
.pre-commit-config.yaml
File metadata and controls
89 lines (79 loc) · 2.55 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# Pre-commit configuration for AI Command Auditor
# See https://pre-commit.com for more information
repos:
# Built-in hooks
- 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: check-json
- id: check-toml
- id: check-xml
- id: check-merge-conflict
- id: check-case-conflict
- id: check-symlinks
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
- id: detect-private-key
- id: mixed-line-ending
args: ['--fix=lf']
# Python formatting and linting
- repo: https://github.com/psf/black
rev: 23.12.1
hooks:
- id: black
language_version: python3
files: ^(ai_command_auditor/.*\.py|scripts/python/.*\.py)$
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
args: ["--profile", "black"]
files: ^(ai_command_auditor/.*\.py|scripts/python/.*\.py)$
- repo: https://github.com/pycqa/pylint
rev: v3.3.7
hooks:
- id: pylint
files: ^(ai_command_auditor/.*\.py|scripts/python/.*\.py)$
additional_dependencies: [pyyaml, openai, requests, click, colorama, jsonschema]
args: ["--exit-zero", "--reports=no"]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
hooks:
- id: mypy
files: ^(ai_command_auditor/.*\.py|scripts/python/.*\.py)$
additional_dependencies: [types-PyYAML, types-requests, click, colorama, jsonschema]
args: ["--ignore-missing-imports", "--no-strict-optional", "--explicit-package-bases"]
# Local hooks
- repo: local
hooks:
- id: comprehensive-lint
name: Comprehensive Linting Check
entry: ./scripts/hooks/pre-commit.sh
language: system
files: ^(scripts/|ai_command_auditor/|\.github/workflows/|.*\.md|.*\.yml|.*\.yaml).*$
pass_filenames: false
# Bash/Shell linting
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.10.0.1
hooks:
- id: shellcheck
files: ^scripts/bash/.*\.sh$
args: [--external-sources]
# YAML and Markdown linting
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.36.0
hooks:
- id: yamllint
args: [-d, 'relaxed']
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.43.0
hooks:
- id: markdownlint
args: [--fix]
# Global settings
ci:
autofix_prs: true
autoupdate_commit_msg: 'chore: update pre-commit hooks'