You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit a5fb27e
Browse filesBrowse the repository at this point in the historyBrowse files
- CLI command: pycodegate (removed py-gate alias)
- Display name: PyCodeGate
- Config file: pycodegate.toml
- TOML key: [tool.pycodegate]
- Dynamic version in output header
- Fixed version test to use __version__
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: AGENTS.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,17 +2,17 @@
2
2
3
3
## Overview
4
4
5
-
py-gate is a Python code quality gate that produces a 0–100 health score. It detects your framework, runs parallel lint and dead-code analysis across 40+ rules, and reports findings by severity so you always know what to fix first.
5
+
pycodegate is a Python code quality gate that produces a 0–100 health score. It detects your framework, runs parallel lint and dead-code analysis across 40+ rules, and reports findings by severity so you always know what to fix first.
6
6
7
7
## Quick Start
8
8
9
9
```bash
10
-
uvx py-gate. --json
10
+
uvx pycodegate. --json
11
11
```
12
12
13
13
## For AI Agents
14
14
15
-
Run `py-gate . --json` after modifying Python files. Fix findings with severity `"error"` first (security, correctness). Re-run to verify the score improved. Target: **80+**.
15
+
Run `pycodegate . --json` after modifying Python files. Fix findings with severity `"error"` first (security, correctness). Re-run to verify the score improved. Target: **80+**.
16
16
17
17
The JSON output includes the score, label, per-diagnostic severity and file location, and detected project context (framework, Python version, package manager).
18
18
@@ -38,7 +38,7 @@ The JSON output includes the score, label, per-diagnostic severity and file loca
38
38
```bash
39
39
uv run pytest -q # run all tests
40
40
uv run ruff check .&& uv run ruff format --check .# lint + format check
41
-
uv run py-gate. --verbose # dogfood on ourselves
41
+
uv run pycodegate. --verbose # dogfood on ourselves
Py Gate starts by detecting your project's context: framework (Django, FastAPI, Flask), Python version, package manager (uv, poetry, pip), and test framework. That context drives which rules are active — Django projects get SQL injection checks, FastAPI projects get async-correctness checks, and so on.
16
+
PyCodeGate starts by detecting your project's context: framework (Django, FastAPI, Flask), Python version, package manager (uv, poetry, pip), and test framework. That context drives which rules are active — Django projects get SQL injection checks, FastAPI projects get async-correctness checks, and so on.
17
17
18
18
It then runs two analysis passes **in parallel**: a lint pass that evaluates 40+ rules across 8 categories (Security, Correctness, Complexity, Architecture, Performance, Structure, Imports, Dead Code), and a dead-code pass powered by [Vulture](https://github.com/jendrikseipp/vulture) that finds unused functions, classes, imports, and variables.
19
19
@@ -24,47 +24,47 @@ Findings are filtered through your configuration and scored using a **weighted c
24
24
Run instantly with `uvx` — no install needed:
25
25
26
26
```bash
27
-
uvx py-gate.
27
+
uvx pycodegate.
28
28
```
29
29
30
30
Install globally with pipx or uv:
31
31
32
32
```bash
33
-
pipx install py-gate
33
+
pipx install pycodegate
34
34
# or
35
-
uv tool install py-gate
35
+
uv tool install pycodegate
36
36
# or
37
-
pip install py-gate
37
+
pip install pycodegate
38
38
```
39
39
40
40
## Quick Start
41
41
42
42
```bash
43
43
# Basic scan — score + summary
44
-
py-gate.
44
+
pycodegate.
45
45
46
46
# Show file paths and line numbers for every finding
47
-
py-gate. --verbose
47
+
pycodegate. --verbose
48
48
49
49
# Machine-readable output for AI agents and CI
50
-
py-gate. --json
50
+
pycodegate. --json
51
51
52
52
# Auto-fix ruff-fixable issues, then scan
53
-
py-gate. --fix
53
+
pycodegate. --fix
54
54
55
55
# Output only the numeric score (useful in scripts)
56
-
py-gate. --score
56
+
pycodegate. --score
57
57
58
58
# Scan only files changed vs a base branch
59
-
py-gate. --diff main
59
+
pycodegate. --diff main
60
60
```
61
61
62
62
## JSON Output
63
63
64
64
Pass `--json` to get structured output that AI agents and CI pipelines can parse:
65
65
66
66
```bash
67
-
py-gate. --json
67
+
pycodegate. --json
68
68
```
69
69
70
70
```json
@@ -105,26 +105,26 @@ py-gate . --json
105
105
106
106
## Agent Integration
107
107
108
-
Py Gate is designed to be used by AI coding agents. Add it to your agent's context so it runs after every Python change.
108
+
PyCodeGate is designed to be used by AI coding agents. Add it to your agent's context so it runs after every Python change.
Or copy `AGENTS.md` to your project root — Claude Code picks it up automatically.
121
121
122
122
### Cursor
123
123
124
-
Add to `.cursor/rules/py-gate.mdc`:
124
+
Add to `.cursor/rules/pycodegate.mdc`:
125
125
126
126
```markdown
127
-
After modifying Python files, run `uvx py-gate . --json` and fix all findings
127
+
After modifying Python files, run `uvx pycodegate . --json` and fix all findings
128
128
with severity "error" before marking the task complete. Target score: 80+.
129
129
```
130
130
@@ -133,7 +133,7 @@ with severity "error" before marking the task complete. Target score: 80+.
133
133
Add to `.windsurfrules`:
134
134
135
135
```
136
-
After modifying Python files, run: uvx py-gate . --json
136
+
After modifying Python files, run: uvx pycodegate . --json
137
137
Fix all "error" severity findings. Re-run to verify the score improved.
138
138
```
139
139
@@ -142,7 +142,7 @@ Fix all "error" severity findings. Re-run to verify the score improved.
142
142
Add to your system prompt:
143
143
144
144
```
145
-
After modifying Python files, run `uvx py-gate . --json` to check code quality.
145
+
After modifying Python files, run `uvx pycodegate . --json` to check code quality.
146
146
Fix errors first. Target score: 80+.
147
147
```
148
148
@@ -160,7 +160,7 @@ name: Quality Gate
160
160
on: [push, pull_request]
161
161
162
162
jobs:
163
-
py-gate:
163
+
pycodegate:
164
164
runs-on: ubuntu-latest
165
165
steps:
166
166
- uses: actions/checkout@v4
@@ -171,10 +171,10 @@ jobs:
171
171
with:
172
172
python-version: "3.12"
173
173
174
-
- name: Run Py Gate
174
+
- name: Run PyCodeGate
175
175
run: |
176
-
pip install py-gate
177
-
py-gate . --verbose --diff main --fail-on error
176
+
pip install pycodegate
177
+
pycodegate . --verbose --diff main --fail-on error
178
178
```
179
179
180
180
## CLI Reference
@@ -210,7 +210,7 @@ Framework-specific rules (Django, FastAPI, Flask) are mapped into the Security o
210
210
211
211
## Scoring
212
212
213
-
Py Gate uses a **weighted category-budget system**:
213
+
PyCodeGate uses a **weighted category-budget system**:
214
214
215
215
1. Each category has a weight (see table above). Weights are normalized to sum to 100 points of total deduction budget.
216
216
2. Within a category, findings are sorted by cost (errors cost more than warnings). The top 3 findings apply at full cost; every additional finding applies **diminishing returns** (10% of its cost).
If both files exist, `py-gate.toml` takes precedence. CLI flags always override config values.
269
+
If both files exist, `pycodegate.toml` takes precedence. CLI flags always override config values.
270
270
271
271
## Profiles
272
272
273
-
Py Gate auto-detects a project profile and adjusts rule weights accordingly. You can also set a profile explicitly in config (`profile = "library"`).
273
+
PyCodeGate auto-detects a project profile and adjusts rule weights accordingly. You can also set a profile explicitly in config (`profile = "library"`).
274
274
275
275
| Profile | Auto-detected when | Adjustments |
276
276
|---------|--------------------|-------------|
@@ -281,10 +281,10 @@ Py Gate auto-detects a project profile and adjusts rule weights accordingly. You
281
281
282
282
## Pre-commit Hook
283
283
284
-
Use `--pre-commit` to run Py Gate as a pre-commit hook. It automatically scans only the staged files:
284
+
Use `--pre-commit` to run PyCodeGate as a pre-commit hook. It automatically scans only the staged files:
285
285
286
286
```bash
287
-
py-gate . --pre-commit --fail-on error
287
+
pycodegate . --pre-commit --fail-on error
288
288
```
289
289
290
290
Add to `.pre-commit-config.yaml`:
@@ -293,9 +293,9 @@ Add to `.pre-commit-config.yaml`:
Copy file name to clipboardExpand all lines: skills/pycodegate/SKILL.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,17 +1,17 @@
1
1
---
2
-
name: py-gate
2
+
name: pycodegate
3
3
description: Run after making Python changes to catch issues early. Use when reviewing code, finishing a feature, or fixing bugs.
4
4
version: 1.0.0
5
5
---
6
6
7
-
# Py Gate
7
+
# PyCodeGate
8
8
9
9
Scans your Python codebase for security, performance, correctness, architecture, and structure issues. Outputs a 0-100 score with actionable diagnostics. Auto-detects Django, FastAPI, and Flask to activate framework-specific rules.
0 commit comments