diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3ec18a7..2f451e0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,7 +3,7 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.3 + rev: v0.1.4 hooks: # Run the Ruff linter. - id: ruff diff --git a/CHANGES.md b/CHANGES.md index bfb1e2d..e35277d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,9 @@ # Changelog +**23.10.8 (2023-11-06)** +* Minimum coverage new configurable +* Added `flake8-todo` to Ruff rules + **23.10.7 (2023-11-03)** * Fixed bug in coverage configuration diff --git a/ambient_package_update/__init__.py b/ambient_package_update/__init__.py index 6231da3..a32cdf5 100644 --- a/ambient_package_update/__init__.py +++ b/ambient_package_update/__init__.py @@ -1,3 +1,3 @@ """Ambient package update tool for clean and swift maintenance""" -__version__ = "23.10.7" +__version__ = "23.10.8" diff --git a/ambient_package_update/metadata/package.py b/ambient_package_update/metadata/package.py index 9cfae3a..8bab3a1 100644 --- a/ambient_package_update/metadata/package.py +++ b/ambient_package_update/metadata/package.py @@ -18,6 +18,7 @@ class PackageMetadata: dependencies: list[str] supported_django_versions: list[str] supported_python_versions: list[str] + min_coverage: float = 100.0 license: str = LICENSE_MIT license_year: int = datetime.datetime.now(tz=datetime.UTC).year optional_dependencies: dict[str, list[str]] = None diff --git a/ambient_package_update/templates/.github/workflows/ci.yml.tpl b/ambient_package_update/templates/.github/workflows/ci.yml.tpl index 8949035..fddd752 100644 --- a/ambient_package_update/templates/.github/workflows/ci.yml.tpl +++ b/ambient_package_update/templates/.github/workflows/ci.yml.tpl @@ -95,4 +95,4 @@ jobs: - name: Combine coverage and fail if it's <100% run: | python -m coverage html --skip-covered --skip-empty - python -m coverage report --fail-under=100 + python -m coverage report --fail-under={{ min_coverage }} diff --git a/ambient_package_update/templates/.pre-commit-config.yaml.tpl b/ambient_package_update/templates/.pre-commit-config.yaml.tpl index 79b64b2..2e849f9 100644 --- a/ambient_package_update/templates/.pre-commit-config.yaml.tpl +++ b/ambient_package_update/templates/.pre-commit-config.yaml.tpl @@ -3,7 +3,7 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.3 + rev: v0.1.4 hooks: # Run the Ruff linter. - id: ruff diff --git a/ambient_package_update/templates/README.md.tpl b/ambient_package_update/templates/README.md.tpl index d5c3b30..1336ed1 100644 --- a/ambient_package_update/templates/README.md.tpl +++ b/ambient_package_update/templates/README.md.tpl @@ -1,6 +1,6 @@ [![PyPI release](https://img.shields.io/pypi/v/{{ package_name|replace("_", "-") }}.svg)](https://pypi.org/project/{{ package_name|replace("_", "-") }}/) [![Downloads](https://static.pepy.tech/badge/{{ package_name|replace("_", "-") }})](https://pepy.tech/project/{{ package_name|replace("_", "-") }}) -[![Coverage](https://img.shields.io/badge/Coverage-100%25-success)](https://github.com/ambient-innovation/{{ package_name|replace("_", "-") }}/actions?workflow=CI) +[![Coverage](https://img.shields.io/badge/Coverage-{{ min_coverage }}%25-success)](https://github.com/ambient-innovation/{{ package_name|replace("_", "-") }}/actions?workflow=CI) [![Linting](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) [![Coding Style](https://img.shields.io/badge/code%20style-Ruff-000000.svg)](https://github.com/astral-sh/ruff) [![Documentation Status](https://readthedocs.org/projects/{{ package_name|replace("_", "-") }}/badge/?version=latest)](https://{{ package_name|replace("_", "-") }}.readthedocs.io/en/latest/?badge=latest) diff --git a/ambient_package_update/templates/pyproject.toml.tpl b/ambient_package_update/templates/pyproject.toml.tpl index 7091d2c..c1c69fa 100644 --- a/ambient_package_update/templates/pyproject.toml.tpl +++ b/ambient_package_update/templates/pyproject.toml.tpl @@ -55,6 +55,7 @@ select = [ "A", # flake8-builtins "DTZ", # flake8-datetimez "DJ", # flake8-django + "TD", # flake8-to-do "RUF100", # Removes unnecessary "#noqa" comments "YTT", # Avoid non-future-prove usages of "sys" # "FBT", # Protects you from the "boolean trap bug" @@ -81,6 +82,7 @@ fixable = [ "A", # flake8-builtins "DTZ", # flake8-datetimez "DJ", # flake8-django + "TD", # flake8-to-do "RUF100", # Removes unnecessary "#noqa" comments "YTT", # Avoid non-future-prove usages of "sys" # "FBT", # Protects you from the "boolean trap bug" diff --git a/pyproject.toml b/pyproject.toml index 6d1e2c8..f7ac748 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -58,6 +58,7 @@ select = [ "A", # flake8-builtins "DTZ", # flake8-datetimez "DJ", # flake8-django + "TD", # flake8-to-do "RUF100", # Removes unnecessary "#noqa" comments "YTT", # Avoid non-future-prove usages of "sys" "FBT", # Protects you from the "boolean trap bug" @@ -86,6 +87,7 @@ fixable = [ "A", # flake8-builtins "DTZ", # flake8-datetimez "DJ", # flake8-django + "TD", # flake8-to-do "RUF100", # Removes unnecessary "#noqa" comments "YTT", # Avoid non-future-prove usages of "sys" "FBT", # Protects you from the "boolean trap bug"