Skip to content

Commit 342e663

Browse files
authored
Merge pull request #555 from nanotaboada/chore/rename-and-extend-slash-commands
chore(claude): rename and extend slash commands
2 parents 7df82e9 + a7d0e71 commit 342e663

File tree

8 files changed

+100
-21
lines changed

8 files changed

+100
-21
lines changed

.claude/commands/pre-commit.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Pre-commit checklist
2+
3+
Before running the checklist, run `git fetch origin`. If the current branch is behind `origin/master`, stop and rebase before proceeding.
4+
5+
Run the pre-commit checklist for this project:
6+
7+
1. Update `CHANGELOG.md` `[Unreleased]` section — add an entry under the
8+
appropriate subsection (Added / Changed / Fixed / Removed) describing the
9+
changes made, referencing the issue number.
10+
2. Run `uv run flake8 .` — must pass.
11+
3. Run `uv run black --check .` — must pass (run `uv run black .` to auto-fix).
12+
4. Run `uv run pytest --cov=./ --cov-report=term --cov-fail-under=80` — all tests must pass, coverage must be ≥80%.
13+
5. If Docker is running, run `docker compose build` — must succeed with no
14+
errors. Skip this step with a note if Docker Desktop is not running.
15+
6. If `coderabbit` CLI is installed, run `coderabbit review --type uncommitted --prompt-only`:
16+
- If actionable/serious findings are reported, stop and address them before proposing the commit.
17+
- If only nitpick-level findings, report them and continue to the commit proposal.
18+
- If `coderabbit` is not installed, skip this step with a note.
19+
20+
Run steps 1–5, report the results clearly, then run step 6 (CodeRabbit review) if available, then propose a branch name and commit message for my approval using the format `type(scope): description (#issue)` (max 80 chars; types: `feat` `fix` `chore` `docs` `test` `refactor` `ci` `perf`). Do not create the branch or commit until I explicitly confirm.
Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,16 @@ open PRs, or create tags until I explicitly confirm.
2020
- **Next codename**: next letter in the A–Z sequence after the current one.
2121
Use lowercase with no spaces for the tag (e.g. `eriksson`);
2222
Title Case for the CHANGELOG heading (e.g. `Eriksson`).
23+
If no tags exist yet, start at `A` (first coach in the table).
24+
If letters were skipped, pick the next after the highest existing
25+
codename — do not backfill gaps.
26+
If the last codename is `Z` (Zeman), the list is finite — stop and
27+
flag that the naming convention needs to be revisited.
2328
- **Version bump** — infer from `[Unreleased]`:
2429

2530
| Condition | Bump |
2631
|---|---|
27-
| Any entry marked BREAKING | MAJOR |
32+
| Any entry marked BREAKING (case-insensitive), `BREAKING CHANGE:` token in a commit footer, or `!` suffix after type/scope (e.g. `feat!:`) | MAJOR |
2833
| Entries under Added | MINOR |
2934
| Only Changed / Fixed / Removed | PATCH |
3035

@@ -63,17 +68,16 @@ open PRs, or create tags until I explicitly confirm.
6368

6469
5. **Propose commit**: `docs(changelog): release vX.Y.Z Codename`
6570

66-
6. **After confirmation**: commit. Then run steps 2–4 of `/precommit` (linting,
67-
formatting, tests — the CHANGELOG step is already handled). Push the branch
68-
and open a PR into `master` only once all checks pass.
71+
6. **After confirmation**: commit. Then run steps 2–5 of `/pre-commit` (linting,
72+
formatting, tests, CodeRabbit review — the CHANGELOG step is already handled).
73+
Push the branch and open a PR into `master` only once all checks pass.
6974

7075
---
7176

7277
## Phase 3 — Tag and release
7378

7479
7. **Stop and wait** for confirmation that:
7580
- All CI checks have passed
76-
- CodeRabbit review comments have been addressed
7781
- The PR has been merged into `master`
7882

7983
8. **Pull `master`**, then propose the annotated tag:

.claude/commands/precommit.md

Lines changed: 0 additions & 12 deletions
This file was deleted.

.dockerignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,23 @@
66
.vscode/
77
htmlcov/
88
postman-collections/
9+
.claude/
10+
CLAUDE.md
911
.codacy.yml
12+
.coderabbit.yaml
1013
.coverage
1114
.coveragerc
1215
.flake8
1316
.gitignore
1417
.pylintrc
18+
CHANGELOG.md
1519
CODE_OF_CONDUCT.md
1620
codecov.yml
1721
commitlint.config.mjs
1822
CONTRIBUTING.md
1923
coverage.xml
2024
LICENSE
25+
.sonarcloud.properties
2126
/tests/
2227
__pycache__/
2328
*.pyc

.sonarcloud.properties

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# =============================================================================
2+
# SonarCloud Automatic Analysis configuration
3+
# https://docs.sonarsource.com/sonarqube-cloud/advanced-setup/automatic-analysis/
4+
#
5+
# SonarCloud's automatic analysis (GitHub App, no CI workflow) reads THIS file.
6+
# Wildcard patterns are NOT supported here, so all exclusion paths must be
7+
# listed explicitly.
8+
# =============================================================================
9+
10+
sonar.projectKey=nanotaboada_python-samples-fastapi-restful
11+
sonar.organization=nanotaboada
12+
sonar.projectName=python-samples-fastapi-restful
13+
14+
sonar.sources=databases,models,routes,schemas,services,tools,main.py
15+
sonar.tests=tests
16+
17+
# =============================================================================
18+
# Global exclusions
19+
# Standalone seed scripts excluded from analysis.
20+
# =============================================================================
21+
22+
sonar.exclusions=\
23+
tools/seed_001_starting_eleven.py,\
24+
tools/seed_002_substitutes.py
25+
26+
# =============================================================================
27+
# Coverage exclusions
28+
# Mirrors codecov.yml ignore list — focus on routes/, services/
29+
# =============================================================================
30+
31+
sonar.coverage.exclusions=\
32+
databases/__init__.py,\
33+
databases/player_database.py,\
34+
models/__init__.py,\
35+
models/player_model.py,\
36+
schemas/__init__.py,\
37+
schemas/player_schema.py,\
38+
tools/seed_001_starting_eleven.py,\
39+
tools/seed_002_substitutes.py,\
40+
tests/__init__.py,\
41+
tests/conftest.py,\
42+
tests/player_stub.py,\
43+
tests/test_main.py,\
44+
main.py
45+
46+
# =============================================================================
47+
# Duplicate code (CPD) exclusions
48+
# Automatic analysis does not support wildcard patterns, so each file is
49+
# listed explicitly.
50+
#
51+
# player_stub.py — test fixture; parallel field assignments by design.
52+
# seed scripts — sequential insert calls are intentionally repetitive.
53+
# =============================================================================
54+
55+
sonar.cpd.exclusions=\
56+
tests/player_stub.py,\
57+
tools/seed_001_starting_eleven.py,\
58+
tools/seed_002_substitutes.py

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ This project uses famous football coaches as release codenames, following an A-Z
4444

4545
### Added
4646

47+
- `.sonarcloud.properties`: SonarCloud Automatic Analysis configuration —
48+
sources, tests, coverage exclusions aligned with `codecov.yml` (#554)
49+
- `.dockerignore`: added `.claude/`, `CLAUDE.md`, `.coderabbit.yaml`,
50+
`.sonarcloud.properties`, `CHANGELOG.md`, `README.md` (#554)
4751
- CD workflow now verifies tag commit is reachable from `master` before
4852
proceeding with build and publish steps (#549)
4953

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44

55
## Claude Code
66

7-
- Run `/precommit` to execute the full pre-commit checklist for this project.
7+
- Run `/pre-commit` to execute the full pre-commit checklist for this project.

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
[![License: MIT](https://img.shields.io/badge/License-MIT-3DA639.svg)](https://opensource.org/licenses/MIT)
1010
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
1111
![Dependabot](https://img.shields.io/badge/Dependabot-contributing-025E8C?logo=dependabot&logoColor=white&labelColor=181818)
12-
![GitHub Copilot](https://img.shields.io/badge/GitHub_Copilot-contributing-8662C5?logo=githubcopilot&logoColor=white&labelColor=181818)
13-
![Claude](https://img.shields.io/badge/Claude-Sonnet_4.6-D97757?logo=claude&logoColor=white&labelColor=181818)
14-
![CodeRabbit Pull Request Reviews](https://img.shields.io/coderabbit/prs/github/nanotaboada/python-samples-fastapi-restful?utm_source=oss&utm_medium=github&utm_campaign=nanotaboada%2Fpython-samples-fastapi-restful&link=https%3A%2F%2Fcoderabbit.ai&label=CodeRabbit+Reviews&labelColor=181818)
12+
![Copilot](https://img.shields.io/badge/Copilot-contributing-8662C5?logo=githubcopilot&logoColor=white&labelColor=181818)
13+
![Claude](https://img.shields.io/badge/Claude-contributing-D97757?logo=claude&logoColor=white&labelColor=181818)
14+
![CodeRabbit](https://img.shields.io/badge/CodeRabbit-reviewing-FF570A?logo=coderabbit&logoColor=white&labelColor=181818)
1515

1616
Proof of Concept for a RESTful API built with [Python 3](https://www.python.org/) and [FastAPI](https://fastapi.tiangolo.com/). Manage football player data with SQLite, SQLAlchemy 2.0 (async), Pydantic validation, and in-memory caching.
1717

0 commit comments

Comments
 (0)