Skip to content

Commit b306e44

Browse files
authored
chore: bring back removed files (#700)
Bring back `.pre-commit-config.yaml` and disabled JSCPD linter. Removal can be evaluated separately, for now bringing them back to make diff against `main` more focused. Re #559.
1 parent 0623015 commit b306e44

2 files changed

Lines changed: 84 additions & 1 deletion

File tree

.github/workflows/linter.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ jobs:
6262
if [[ "${{ steps.ruff-lint.outcome }}" == "failure" || \
6363
"${{ steps.ruff-format.outcome }}" == "failure" || \
6464
"${{ steps.mypy.outcome }}" == "failure" || \
65-
"${{ steps.pyright.outcome }}" == "failure" ]]; then
65+
"${{ steps.pyright.outcome }}" == "failure" || \
66+
"${{ steps.jscpd.outcome }}" == "failure" ]]; then
6667
echo "One or more linting/checking steps failed."
6768
exit 1
6869
fi

.pre-commit-config.yaml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
repos:
3+
# ===============================================
4+
# Pre-commit standard hooks (general file cleanup)
5+
# ===============================================
6+
- repo: https://github.com/pre-commit/pre-commit-hooks
7+
rev: v5.0.0
8+
hooks:
9+
- id: trailing-whitespace # Removes extra whitespace at the end of lines
10+
- id: end-of-file-fixer # Ensures files end with a newline
11+
- id: check-yaml # Checks YAML file syntax (before formatting)
12+
- id: check-toml # Checks TOML file syntax (before formatting)
13+
- id: check-added-large-files # Prevents committing large files
14+
args: [--maxkb=500] # Example: Limit to 500KB
15+
- id: check-merge-conflict # Checks for merge conflict strings
16+
- id: detect-private-key # Detects accidental private key commits
17+
18+
# Formatter and linter for TOML files
19+
- repo: https://github.com/ComPWA/taplo-pre-commit
20+
rev: v0.9.3
21+
hooks:
22+
- id: taplo-format
23+
- id: taplo-lint
24+
25+
# YAML files
26+
- repo: https://github.com/lyz-code/yamlfix
27+
rev: 1.17.0
28+
hooks:
29+
- id: yamlfix
30+
31+
# ===============================================
32+
# Python Hooks
33+
# ===============================================
34+
# no_implicit_optional for ensuring explicit Optional types
35+
- repo: https://github.com/hauntsaninja/no_implicit_optional
36+
rev: '1.4'
37+
hooks:
38+
- id: no_implicit_optional
39+
args: [--use-union-or]
40+
41+
# Pyupgrade for upgrading Python syntax to newer versions
42+
- repo: https://github.com/asottile/pyupgrade
43+
rev: v3.20.0
44+
hooks:
45+
- id: pyupgrade
46+
args: [--py310-plus] # Target Python 3.10+ syntax, matching project's target
47+
48+
# Autoflake for removing unused imports and variables
49+
- repo: https://github.com/pycqa/autoflake
50+
rev: v2.3.1
51+
hooks:
52+
- id: autoflake
53+
args: [--in-place, --remove-all-unused-imports]
54+
55+
# Ruff for linting and formatting
56+
- repo: https://github.com/astral-sh/ruff-pre-commit
57+
rev: v0.12.0
58+
hooks:
59+
- id: ruff
60+
args: [--fix, --exit-zero] # Apply fixes, and exit with 0 even if files were modified
61+
exclude: ^src/a2a/grpc/
62+
- id: ruff-format
63+
exclude: ^src/a2a/grpc/
64+
65+
# Keep uv.lock in sync
66+
- repo: https://github.com/astral-sh/uv-pre-commit
67+
rev: 0.7.13
68+
hooks:
69+
- id: uv-lock
70+
71+
# Commitzen for conventional commit messages
72+
- repo: https://github.com/commitizen-tools/commitizen
73+
rev: v4.8.3
74+
hooks:
75+
- id: commitizen
76+
stages: [commit-msg]
77+
78+
# Gitleaks
79+
- repo: https://github.com/gitleaks/gitleaks
80+
rev: v8.27.2
81+
hooks:
82+
- id: gitleaks

0 commit comments

Comments
 (0)