diff --git a/.github/prompts/template-testing.prompt.md b/.agents/skills/template-testing/SKILL.md similarity index 97% rename from .github/prompts/template-testing.prompt.md rename to .agents/skills/template-testing/SKILL.md index c339f3a..47ebb65 100644 --- a/.github/prompts/template-testing.prompt.md +++ b/.agents/skills/template-testing/SKILL.md @@ -1,4 +1,5 @@ --- +name: template-testing description: "Comprehensive testing of the cookiecutter template across all configurations." --- @@ -39,7 +40,7 @@ make mypy_check # Type checking make ruff_check # Linting ``` -Note: Formatting issues (dapperdata, tomlsort, paracelsus) can be auto-fixed with `make chores` and are not critical for validation. +Note: Formatting issues (prettier, tomlsort, paracelsus) can be auto-fixed with `make chores` and are not critical for validation. #### Step 3: Verify Results @@ -136,7 +137,6 @@ Standard configurations should produce these results: After testing, provide a summary that includes: 1. **Configuration Results**: For each tested configuration - - Configuration name - Number of tests run - Number of tests passed/failed @@ -144,7 +144,6 @@ After testing, provide a summary that includes: - Any errors or warnings 2. **Test Output Analysis**: Key findings from test execution - - Any deprecation warnings - Performance issues - Coverage gaps in important modules diff --git a/README.md b/README.md index 7ae21e3..cb8dfcd 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Transform any Python idea into a production-ready project in minutes. This Cooki ## Why Choose This Template? -- **Modern Development Tools**: Get a fully configured environment with Ruff (formatting/linting), mypy (type checking), pytest (testing), and pre-commit hooks ready to use +- **Modern Development Tools**: Get a fully configured environment with Ruff (formatting/linting), prettier (YAML/JSON/Markdown formatting), mypy (type checking), pytest (testing), and pre-commit hooks ready to use - **Production-Ready Frameworks**: Optional integration with FastAPI (web APIs), Celery (distributed tasks), SQLAlchemy + Alembic (database ORM), and QuasiQueue (multiprocessing) - **Professional Infrastructure**: Includes Docker containerization, GitHub Actions CI/CD, Pydantic Settings for configuration, and Makefile automation - **Developer-Friendly CLI**: Optional Typer integration for building beautiful command-line interfaces with automatic help and shell completion @@ -47,6 +47,7 @@ Every project created with this template includes these essential components: - **[Ruff](https://docs.astral.sh/ruff/)**: Blazingly fast Python linter and formatter (10-100x faster than Black) that replaces multiple tools (Flake8, isort, Black) with a single, zero-configuration solution written in Rust - **[mypy](https://mypy.readthedocs.io/en/stable/)**: Industry-standard static type checker that catches type-related bugs before runtime, providing IDE autocompletion and making refactoring safer +- **[prettier](https://prettier.io/)**: Universal code formatter for YAML, JSON, Markdown, and other config files, running via npx with no Python dependency needed and consistent formatting across all supported file types - **[pytest](https://docs.pytest.org/)**: Python's most popular testing framework with powerful fixtures, parametrization, full async/await support, and extensive plugin ecosystem for testing web apps, databases, and more - **Coverage reporting**: Comprehensive test coverage tracking with support for multiprocess and distributed applications, ensuring your tests exercise all code paths @@ -153,7 +154,7 @@ Pick and choose the features you need. Unused components are completely removed **Comprehensive [GitHub Actions](https://docs.github.com/en/actions)** - Matrix testing across multiple Python versions (3.10, 3.11, 3.12, 3.13, 3.14) to ensure broad compatibility before release -- Automated code quality enforcement with Ruff for formatting and linting, mypy for type checking, and pytest for test execution +- Automated code quality enforcement with Ruff for formatting and linting, prettier for YAML/JSON/Markdown formatting, mypy for type checking, and pytest for test execution - Fully automated PyPI publishing triggered by git tags, with automatic changelog generation, version bumping, and release notes from commit messages - Container image building and multi-architecture publishing to GitHub Container Registry and Docker Hub, with automatic tagging based on branches and release/tag versions - Intelligent dependency updates using Dependabot and [uv](https://pypi.org/project/uv/) lockfile management for fast, reproducible builds and automated PR creation for updates diff --git a/{{cookiecutter.__package_slug}}/.github/workflows/dapperdata.yaml b/{{cookiecutter.__package_slug}}/.github/workflows/dapperdata.yaml deleted file mode 100644 index e83e5a3..0000000 --- a/{{cookiecutter.__package_slug}}/.github/workflows/dapperdata.yaml +++ /dev/null @@ -1,24 +0,0 @@ -name: Configuration File Formatting - -on: - push: - pull_request: - -jobs: - dapperdata: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - - name: Install uv - uses: astral-sh/setup-uv@v7 - - - uses: actions/setup-python@v6 - with: - python-version-file: .python-version - - - name: Install Dependencies - run: make install - - - name: Test Formatting - run: make dapperdata_check diff --git a/{{cookiecutter.__package_slug}}/.github/workflows/prettier.yaml b/{{cookiecutter.__package_slug}}/.github/workflows/prettier.yaml new file mode 100644 index 0000000..e459531 --- /dev/null +++ b/{{cookiecutter.__package_slug}}/.github/workflows/prettier.yaml @@ -0,0 +1,14 @@ +name: Configuration File Formatting + +on: + push: + pull_request: + +jobs: + prettier: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + + - name: Check Formatting + run: npx --yes prettier --check . --log-level warn diff --git a/{{cookiecutter.__package_slug}}/.prettierignore b/{{cookiecutter.__package_slug}}/.prettierignore new file mode 100644 index 0000000..5fcc4ab --- /dev/null +++ b/{{cookiecutter.__package_slug}}/.prettierignore @@ -0,0 +1,7 @@ +.venv/ +{{cookiecutter.__package_slug}}.egg-info/ +tmp/ +.*/**/*.md +{%- if cookiecutter.include_sqlalchemy == "y" %} +docs/dev/database.md +{%- endif %} diff --git a/{{cookiecutter.__package_slug}}/AGENTS.md b/{{cookiecutter.__package_slug}}/AGENTS.md index 621c5f8..5258789 100644 --- a/{{cookiecutter.__package_slug}}/AGENTS.md +++ b/{{cookiecutter.__package_slug}}/AGENTS.md @@ -25,7 +25,7 @@ git mv old_path new_path # ALWAYS use git mv for moving or renaming files, never ### Testing and Validation ```bash -make tests # Run all tests and checks (pytest, ruff, black, mypy, dapperdata, tomlsort) +make tests # Run all tests and checks (pytest, ruff, black, mypy, prettier, tomlsort) make pytest # Run pytest with coverage report make pytest_loud # Run pytest with debug logging enabled uv run pytest # Run pytest directly with uv, adding any arguments and options needed @@ -37,17 +37,17 @@ uv run pytest # Run pytest directly with uv, adding any arguments and options ne make ruff_check # Check code with ruff linter make black_check # Check code formatting with ruff format using the black format make mypy_check # Run type checking with mypy -make dapperdata_check # Check data file formatting +make prettier_check # Check markdown/json/yaml/etc formatting with prettier make tomlsort_check # Check TOML file linting and formatting ``` ### Code Formatting (Auto-fix) ```bash -make chores # Run all formatting fixes (ruff, black, dapperdata, tomlsort) +make chores # Run all formatting fixes (ruff, black, prettier, tomlsort) make ruff_fixes # Auto-fix ruff issues make black_fixes # Auto-format code with ruff using the black format -make dapperdata_fixes # Auto-format data files +make prettier_fixes # Auto-format markdown/json/yaml/etc make tomlsort_fixes # Auto-format TOML files ``` diff --git a/{{cookiecutter.__package_slug}}/docs/dev/dependencies.md b/{{cookiecutter.__package_slug}}/docs/dev/dependencies.md index b98dcda..b93bf76 100644 --- a/{{cookiecutter.__package_slug}}/docs/dev/dependencies.md +++ b/{{cookiecutter.__package_slug}}/docs/dev/dependencies.md @@ -110,7 +110,7 @@ Development dependencies are organized in the `[project.optional-dependencies]` - **ruff**: Fast Python linter and formatter (replaces Black, isort, Flake8) - **mypy**: Static type checker for catching type-related bugs - **build**: PEP 517 build frontend for creating distribution packages -- **dapperdata**: Data formatting and validation tool +- **prettier**: Universal code formatter for YAML, JSON, Markdown, and other config files (runs via npx) - **glom**: Nested data access and transformation - **greenlet**: Lightweight concurrent programming support (required for coverage with async) - **toml-sort**: Automatic TOML file sorting for consistency diff --git a/{{cookiecutter.__package_slug}}/docs/dev/github.md b/{{cookiecutter.__package_slug}}/docs/dev/github.md index fcf4580..ae3cdad 100644 --- a/{{cookiecutter.__package_slug}}/docs/dev/github.md +++ b/{{cookiecutter.__package_slug}}/docs/dev/github.md @@ -37,11 +37,11 @@ The project includes the following GitHub Actions workflows in `.github/workflow - **Purpose**: Validates type hints and catches type-related errors - **Command**: `make mypy_check` -**dapperdata.yaml** - Data Format Validation +**prettier.yaml** - Configuration File Formatting - **Trigger**: Every push and pull request -- **Purpose**: Validates data file formatting (YAML, JSON, etc.) -- **Command**: `make dapperdata_check` +- **Purpose**: Validates markdown/JSON/YAML/config file formatting with prettier +- **Command**: `make prettier_check` **tomlsort.yaml** - TOML File Sorting diff --git a/{{cookiecutter.__package_slug}}/docs/dev/makefile.md b/{{cookiecutter.__package_slug}}/docs/dev/makefile.md index caf7382..f8abd8a 100644 --- a/{{cookiecutter.__package_slug}}/docs/dev/makefile.md +++ b/{{cookiecutter.__package_slug}}/docs/dev/makefile.md @@ -150,7 +150,7 @@ make uv - Fixes linting issues with Ruff - Formats code with Black (via Ruff) -- Formats data files with dapperdata +- Formats markdown/JSON/YAML/config files with prettier - Sorts TOML files {%- if cookiecutter.include_sqlalchemy == "y" %} - Updates database schema documentation @@ -197,21 +197,22 @@ make ruff_fixes make black_fixes ``` -### `make dapperdata_fixes` +### `make prettier_fixes` -**Purpose**: Format JSON and YAML data files. +**Purpose**: Format markdown, JSON, YAML, and other config files. **What it does**: -- Pretty-prints JSON files - Formats YAML files consistently -- Fixes indentation and structure +- Pretty-prints JSON files +- Formats markdown files +- Handles other supported file types (TOML, CSS, etc.) **Usage**: ```bash -# Format data files -make dapperdata_fixes +# Format config and data files +make prettier_fixes ``` ### `make tomlsort_fixes` @@ -243,7 +244,7 @@ make tomlsort_fixes 3. Checks linting (ruff) 4. Checks formatting (black) 5. Runs type checking (mypy) -6. Checks data file formatting +6. Checks config/markdown formatting (prettier) 7. Checks TOML file sorting {%- if cookiecutter.include_sqlalchemy == "y" %} 8. Verifies database schema documentation is up-to-date @@ -363,20 +364,20 @@ make black_check make mypy_check ``` -### `make dapperdata_check` +### `make prettier_check` -**Purpose**: Check data file formatting without modifying. +**Purpose**: Check markdown, JSON, YAML, and config file formatting without modifying. **What it does**: -- Verifies JSON/YAML files are properly formatted +- Verifies YAML/JSON/markdown files are properly formatted - Exits with error if files need formatting **Usage**: ```bash -# Check data file formatting -make dapperdata_check +# Check config and data file formatting +make prettier_check ``` ### `make tomlsort_check` diff --git a/{{cookiecutter.__package_slug}}/docs/dev/testing.md b/{{cookiecutter.__package_slug}}/docs/dev/testing.md index 341e911..8130aac 100644 --- a/{{cookiecutter.__package_slug}}/docs/dev/testing.md +++ b/{{cookiecutter.__package_slug}}/docs/dev/testing.md @@ -790,7 +790,7 @@ Tests run automatically on every push and pull request via GitHub Actions. The C 2. **Checks code formatting** with ruff 3. **Performs type checking** with mypy 4. **Validates linting rules** with ruff -5. **Checks data formatting** with dapperdata +5. **Checks config/markdown formatting** with prettier 6. **Verifies TOML formatting** with toml-sort See the [GitHub Actions documentation](./github.md) for more details on CI configuration. diff --git a/{{cookiecutter.__package_slug}}/makefile b/{{cookiecutter.__package_slug}}/makefile index d077504..64de5ca 100644 --- a/{{cookiecutter.__package_slug}}/makefile +++ b/{{cookiecutter.__package_slug}}/makefile @@ -58,10 +58,10 @@ pre-commit: {%- if cookiecutter.include_sqlalchemy == "y" %} .PHONY: chores -chores: ruff_fixes black_fixes dapperdata_fixes tomlsort_fixes document_schema +chores: ruff_fixes black_fixes prettier_fixes tomlsort_fixes document_schema {%- else %} .PHONY: chores -chores: ruff_fixes black_fixes dapperdata_fixes tomlsort_fixes +chores: ruff_fixes black_fixes prettier_fixes tomlsort_fixes {%- endif %} .PHONY: ruff_fixes @@ -72,9 +72,9 @@ ruff_fixes: black_fixes: $(UV) run ruff format . -.PHONY: dapperdata_fixes -dapperdata_fixes: - $(UV) run python -m dapperdata.cli pretty . --no-dry-run +.PHONY: prettier_fixes +prettier_fixes: + npx --yes prettier --write . --log-level warn .PHONY: tomlsort_fixes tomlsort_fixes: @@ -86,10 +86,10 @@ tomlsort_fixes: {%- if cookiecutter.include_sqlalchemy == "y" %} .PHONY: tests -tests: install pytest ruff_check black_check mypy_check dapperdata_check tomlsort_check paracelsus_check +tests: install pytest ruff_check black_check mypy_check prettier_check tomlsort_check paracelsus_check {%- else %} .PHONY: tests -tests: install pytest ruff_check black_check mypy_check dapperdata_check tomlsort_check +tests: install pytest ruff_check black_check mypy_check prettier_check tomlsort_check {%- endif %} .PHONY: pytest @@ -112,9 +112,9 @@ black_check: mypy_check: $(UV) run mypy ${PACKAGE_SLUG} -.PHONY: dapperdata_check -dapperdata_check: - $(UV) run python -m dapperdata.cli pretty . +.PHONY: prettier_check +prettier_check: + npx --yes prettier --check . --log-level warn .PHONY: tomlsort_check tomlsort_check: diff --git a/{{cookiecutter.__package_slug}}/pyproject.toml b/{{cookiecutter.__package_slug}}/pyproject.toml index 567891a..7f2274b 100644 --- a/{{cookiecutter.__package_slug}}/pyproject.toml +++ b/{{cookiecutter.__package_slug}}/pyproject.toml @@ -65,7 +65,6 @@ dependencies = [ [dependency-groups] dev = [ "build", - "dapperdata", "glom", "greenlet", {%- if cookiecutter.include_fastapi == "y" %}