From 5afc7767e28216bb83e83ae288ca8f569aa3dc56 Mon Sep 17 00:00:00 2001 From: "Benjamin T. Vincent" Date: Sat, 22 Nov 2025 10:49:56 +0000 Subject: [PATCH] Add code quality and linting guidelines to AGENTS.md Introduces a new section detailing code quality checks, including pre-commit usage, ruff commands for linting and formatting, and notes on linting rules and documentation exclusions. --- AGENTS.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/AGENTS.md b/AGENTS.md index 9baa28eb..a4f8848f 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -41,6 +41,15 @@ - **Custom exceptions**: Use project-specific exceptions from `causalpy.custom_exceptions`: `FormulaException`, `DataException`, `BadIndexException` - **File organization**: Experiments in `causalpy/experiments/`, PyMC models in `causalpy/pymc_models.py`, scikit-learn models in `causalpy/skl_models.py` +## Code quality checks + +- **Before committing**: Always run `pre-commit run --all-files` to ensure all checks pass (linting, formatting, type checking) +- **Quick check**: Run `ruff check causalpy/` for fast linting feedback during development +- **Auto-fix**: Run `ruff check --fix causalpy/` to automatically fix many linting issues +- **Format**: Run `ruff format causalpy/` to format code according to project standards +- **Linting rules**: Project uses strict linting (F, B, UP, C4, SIM, I) to catch bugs and enforce modern Python patterns +- **Note**: Documentation notebooks in `docs/` are excluded from strict linting rules + ## Type Checking - **Tool**: MyPy