Skip to content

Commit a5fb27e

Browse files
themohitkhareclaude
andcommitted
chore: unify branding to PyCodeGate everywhere
- 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>
1 parent 4a13737 commit a5fb27e

18 files changed

Lines changed: 95 additions & 92 deletions

‎AGENTS.md‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22

33
## Overview
44

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.
66

77
## Quick Start
88

99
```bash
10-
uvx py-gate . --json
10+
uvx pycodegate . --json
1111
```
1212

1313
## For AI Agents
1414

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+**.
1616

1717
The JSON output includes the score, label, per-diagnostic severity and file location, and detected project context (framework, Python version, package manager).
1818

@@ -38,7 +38,7 @@ The JSON output includes the score, label, per-diagnostic severity and file loca
3838
```bash
3939
uv run pytest -q # run all tests
4040
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
4242
```
4343

4444
## Adding Rules
@@ -56,7 +56,7 @@ src/pycodegate/
5656
api.py — Programmatic API (diagnose function)
5757
scan.py — Orchestrator: parallel lint + dead code
5858
score.py — Score calculation from diagnostics
59-
config.py — Config loading (py-gate.toml / pyproject.toml)
59+
config.py — Config loading (pycodegate.toml / pyproject.toml)
6060
discover.py — Project detection (framework, package manager, etc.)
6161
output.py — Rich terminal output
6262
types.py — All data types (Diagnostic, Score, etc.)

‎README.md‎

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
<h1 align="center">Py Gate</h1>
1+
<h1 align="center">PyCodeGate</h1>
22
<p align="center">
33
<strong>One command. One score. Your Python quality gate.</strong>
44
</p>
55
<p align="center">
66
<a href="https://github.com/themohitkhare/pycodegate/actions/workflows/ci.yml"><img src="https://github.com/themohitkhare/pycodegate/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
7-
<a href="https://pypi.org/project/py-gate/"><img src="https://img.shields.io/pypi/v/py-gate" alt="PyPI"></a>
8-
<a href="https://pypi.org/project/py-gate/"><img src="https://img.shields.io/pypi/pyversions/py-gate" alt="Python"></a>
7+
<a href="https://pypi.org/project/pycodegate/"><img src="https://img.shields.io/pypi/v/pycodegate" alt="PyPI"></a>
8+
<a href="https://pypi.org/project/pycodegate/"><img src="https://img.shields.io/pypi/pyversions/pycodegate" alt="Python"></a>
99
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License: MIT"></a>
1010
</p>
1111

1212
---
1313

1414
## How it works
1515

16-
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.
1717

1818
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.
1919

@@ -24,47 +24,47 @@ Findings are filtered through your configuration and scored using a **weighted c
2424
Run instantly with `uvx` — no install needed:
2525

2626
```bash
27-
uvx py-gate .
27+
uvx pycodegate .
2828
```
2929

3030
Install globally with pipx or uv:
3131

3232
```bash
33-
pipx install py-gate
33+
pipx install pycodegate
3434
# or
35-
uv tool install py-gate
35+
uv tool install pycodegate
3636
# or
37-
pip install py-gate
37+
pip install pycodegate
3838
```
3939

4040
## Quick Start
4141

4242
```bash
4343
# Basic scan — score + summary
44-
py-gate .
44+
pycodegate .
4545

4646
# Show file paths and line numbers for every finding
47-
py-gate . --verbose
47+
pycodegate . --verbose
4848

4949
# Machine-readable output for AI agents and CI
50-
py-gate . --json
50+
pycodegate . --json
5151

5252
# Auto-fix ruff-fixable issues, then scan
53-
py-gate . --fix
53+
pycodegate . --fix
5454

5555
# Output only the numeric score (useful in scripts)
56-
py-gate . --score
56+
pycodegate . --score
5757

5858
# Scan only files changed vs a base branch
59-
py-gate . --diff main
59+
pycodegate . --diff main
6060
```
6161

6262
## JSON Output
6363

6464
Pass `--json` to get structured output that AI agents and CI pipelines can parse:
6565

6666
```bash
67-
py-gate . --json
67+
pycodegate . --json
6868
```
6969

7070
```json
@@ -105,26 +105,26 @@ py-gate . --json
105105

106106
## Agent Integration
107107

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.
109109

110110
### Claude Code
111111

112112
Add the skill to your project:
113113

114114
```bash
115115
mkdir -p .claude/skills
116-
curl -fsSL https://raw.githubusercontent.com/themohitkhare/pycodegate/main/skills/py-gate/SKILL.md \
117-
-o .claude/skills/py-gate.md
116+
curl -fsSL https://raw.githubusercontent.com/themohitkhare/pycodegate/main/skills/pycodegate/SKILL.md \
117+
-o .claude/skills/pycodegate.md
118118
```
119119

120120
Or copy `AGENTS.md` to your project root — Claude Code picks it up automatically.
121121

122122
### Cursor
123123

124-
Add to `.cursor/rules/py-gate.mdc`:
124+
Add to `.cursor/rules/pycodegate.mdc`:
125125

126126
```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
128128
with severity "error" before marking the task complete. Target score: 80+.
129129
```
130130

@@ -133,7 +133,7 @@ with severity "error" before marking the task complete. Target score: 80+.
133133
Add to `.windsurfrules`:
134134

135135
```
136-
After modifying Python files, run: uvx py-gate . --json
136+
After modifying Python files, run: uvx pycodegate . --json
137137
Fix all "error" severity findings. Re-run to verify the score improved.
138138
```
139139

@@ -142,7 +142,7 @@ Fix all "error" severity findings. Re-run to verify the score improved.
142142
Add to your system prompt:
143143

144144
```
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.
146146
Fix errors first. Target score: 80+.
147147
```
148148

@@ -160,7 +160,7 @@ name: Quality Gate
160160
on: [push, pull_request]
161161

162162
jobs:
163-
py-gate:
163+
pycodegate:
164164
runs-on: ubuntu-latest
165165
steps:
166166
- uses: actions/checkout@v4
@@ -171,10 +171,10 @@ jobs:
171171
with:
172172
python-version: "3.12"
173173

174-
- name: Run Py Gate
174+
- name: Run PyCodeGate
175175
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
178178
```
179179
180180
## CLI Reference
@@ -210,7 +210,7 @@ Framework-specific rules (Django, FastAPI, Flask) are mapped into the Security o
210210

211211
## Scoring
212212

213-
Py Gate uses a **weighted category-budget system**:
213+
PyCodeGate uses a **weighted category-budget system**:
214214

215215
1. Each category has a weight (see table above). Weights are normalized to sum to 100 points of total deduction budget.
216216
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).
@@ -226,7 +226,7 @@ Py Gate uses a **weighted category-budget system**:
226226

227227
## Configuration
228228

229-
Create `py-gate.toml` in your project root:
229+
Create `pycodegate.toml` in your project root:
230230

231231
```toml
232232
[options]
@@ -250,27 +250,27 @@ max-deduction.Dead Code = 0 # disable dead-code penalty entirely
250250
Or use `pyproject.toml`:
251251

252252
```toml
253-
[tool.py-gate]
253+
[tool.pycodegate]
254254
lint = true
255255
dead_code = true
256256
fail_on = "error"
257257
258-
[tool.py-gate.ignore]
258+
[tool.pycodegate.ignore]
259259
rules = ["no-import-in-function"]
260260
files = ["tests/fixtures/**"]
261261
262-
[tool.py-gate.per-file-ignores]
262+
[tool.pycodegate.per-file-ignores]
263263
"src/legacy/*.py" = ["high-complexity"]
264264
265-
[tool.py-gate.scoring]
265+
[tool.pycodegate.scoring]
266266
"max-deduction" = { Security = 20, "Dead Code" = 0 }
267267
```
268268

269-
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.
270270

271271
## Profiles
272272

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"`).
274274

275275
| Profile | Auto-detected when | Adjustments |
276276
|---------|--------------------|-------------|
@@ -281,10 +281,10 @@ Py Gate auto-detects a project profile and adjusts rule weights accordingly. You
281281

282282
## Pre-commit Hook
283283

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:
285285

286286
```bash
287-
py-gate . --pre-commit --fail-on error
287+
pycodegate . --pre-commit --fail-on error
288288
```
289289

290290
Add to `.pre-commit-config.yaml`:
@@ -293,9 +293,9 @@ Add to `.pre-commit-config.yaml`:
293293
repos:
294294
- repo: local
295295
hooks:
296-
- id: py-gate
297-
name: Py Gate quality check
298-
entry: py-gate . --pre-commit --fail-on error
296+
- id: pycodegate
297+
name: PyCodeGate quality check
298+
entry: pycodegate . --pre-commit --fail-on error
299299
language: system
300300
types: [python]
301301
pass_filenames: false
@@ -308,7 +308,7 @@ git clone https://github.com/themohitkhare/pycodegate
308308
cd pycodegate
309309
uv sync --all-extras
310310
uv run pytest -q
311-
uv run py-gate . --verbose # dogfood it
311+
uv run pycodegate . --verbose # dogfood it
312312
```
313313

314314
To add a new rule:

‎pyproject.toml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "pycodegate"
3-
version = "0.1.1"
3+
version = "0.1.2"
44
description = "One command. One score. Your Python quality gate."
55
readme = "README.md"
66
requires-python = ">=3.10"
@@ -42,7 +42,7 @@ dev = [
4242

4343
[project.scripts]
4444
pycodegate = "pycodegate.cli:main"
45-
py-gate = "pycodegate.cli:main"
45+
4646

4747
[build-system]
4848
requires = ["hatchling"]
@@ -70,6 +70,6 @@ ignore = ["SIM102"] # nested ifs in AST walking are clearer than combined condi
7070
"src/pycodegate/rules/base.py" = ["TC001"] # runtime import in abstract method
7171
"src/pycodegate/utils/*.py" = ["E501"]
7272

73-
[tool.py-gate]
74-
[tool.py-gate.ignore]
73+
[tool.pycodegate]
74+
[tool.pycodegate.ignore]
7575
files = ["tests/fixtures/**"]
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
---
2-
name: py-gate
2+
name: pycodegate
33
description: Run after making Python changes to catch issues early. Use when reviewing code, finishing a feature, or fixing bugs.
44
version: 1.0.0
55
---
66

7-
# Py Gate
7+
# PyCodeGate
88

99
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.
1010

1111
## Usage
1212

1313
```bash
14-
uvx py-gate . --verbose --diff
14+
uvx pycodegate . --verbose --diff
1515
```
1616

1717
## Workflow

‎src/pycodegate/__init__.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""Python Doctor - Diagnose your Python project's health."""
22

3-
__version__ = "0.1.1"
3+
__version__ = "0.1.2"
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

‎src/pycodegate/cli.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818

1919
@click.command(context_settings={"help_option_names": ["-h", "--help"]})
20-
@click.version_option(__version__, "-v", "--version", prog_name="Py Gate")
20+
@click.version_option(__version__, "-v", "--version", prog_name="PyCodeGate")
2121
@click.argument("directory", default=".", type=click.Path(exists=True))
2222
@click.option("--lint/--no-lint", default=True, help="Enable/disable lint checks.")
2323
@click.option(
@@ -79,7 +79,7 @@ def main(
7979
precommit: bool,
8080
min_score: int | None,
8181
) -> None:
82-
"""Py Gate — Diagnose your Python project's health."""
82+
"""PyCodeGate — Diagnose your Python project's health."""
8383
if ci_workflow:
8484
click.echo(generate_ci_workflow(), nl=False)
8585
return
@@ -125,7 +125,7 @@ def main(
125125

126126
if min_score is not None and result.score.value < min_score:
127127
click.echo(
128-
f"py-gate: score {result.score.value} is below minimum {min_score}",
128+
f"pycodegate: score {result.score.value} is below minimum {min_score}",
129129
err=True,
130130
)
131131
sys.exit(1)

‎src/pycodegate/config.py‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Configuration loading for py-gate."""
1+
"""Configuration loading for pycodegate."""
22

33
from __future__ import annotations
44

@@ -22,11 +22,11 @@ class Config:
2222

2323

2424
def load_config(project_path: str) -> Config:
25-
"""Load config from py-gate.toml or pyproject.toml [tool.py-gate]."""
25+
"""Load config from pycodegate.toml or pyproject.toml [tool.pycodegate]."""
2626
root = Path(project_path)
2727

28-
# py-gate.toml takes precedence
29-
doctor_toml = root / "py-gate.toml"
28+
# pycodegate.toml takes precedence
29+
doctor_toml = root / "pycodegate.toml"
3030
if doctor_toml.exists():
3131
return _parse_doctor_toml(doctor_toml)
3232

@@ -62,7 +62,7 @@ def _parse_pyproject_toml(path: Path) -> Config:
6262
with open(path, "rb") as f:
6363
data = tomllib.load(f)
6464

65-
section = data.get("tool", {}).get("py-gate", {})
65+
section = data.get("tool", {}).get("pycodegate", {})
6666
if not section:
6767
return Config()
6868

0 commit comments

Comments
 (0)