Skip to content

build: migrate to Ruff and refresh README badges - #39

Merged
jaimeib merged 6 commits into
mainfrom
chore/ruff-and-badges
Oct 27, 2026
Merged

jaimeib merged 6 commits into
mainfrom
chore/ruff-and-badges

Conversation

@jaimeib

@jaimeib jaimeib commented Oct 27, 2026

Copy link
Copy Markdown
Member

Description

Migrate wattnet-api from black, isort and flake8 to Ruff for both linting and formatting, and align the README and community files with the Wattnet repository reference (wattnet-repo-template).

  • build: Ruff configuration in pyproject.toml, tox environments lint, format and format-check, and Ruff hooks in pre-commit. The old lint and format dependency groups are removed. Tests are exempt from the docstring and line length rules so that ruff check . passes on the whole repository.
  • style: ruff format and the safe ruff check fixes applied to the package and the tests. Four duplicated test functions that were shadowed by an identical later definition (F811) are removed.
  • docs: new badge table and Conventional Commits badge, a poetry install command in CONTRIBUTING.md that no longer references the removed format group, and a SECURITY.md scope that named wattnet-storage instead of wattnet-api. The wording of the pull request and issue templates is normalized, and dependabot.yml uses two-space indentation.

No runtime behavior changes. The only source changes are formatting and the zip(..., strict=...) arguments required by the B905 rule.

Type of change

  • Bug fix
  • New feature
  • Refactor (no functional change)
  • Documentation
  • CI / tooling
  • Other:

Checklist

  • All existing tests pass (pytest / tox)
  • New tests added for the changed behavior
  • Code is formatted (ruff format .)
  • Linter passes (ruff check wattnet)
  • Type-check passes (mypy -p wattnet.api)
  • Security scan passes (bandit -r wattnet/)
  • Docstrings updated where needed
  • README badges and links still accurate
  • CONTRIBUTING.md still accurate

Notes for reviewers

The full tox matrix passes locally on all 12 environments (Python 3.10 to 3.14, lint, format-check, bandit, mypy, deptry, pypi and wheel).

The commits are split so they can be reviewed or reverted separately: build (tooling), style (formatting, large but mechanical) and docs. The two earlier README badge commits are also part of this branch.

feat/openapi-bearer-scheme does not touch any file changed here, and its files already pass the new Ruff configuration, so it should rebase on main without Ruff-related conflicts.

Replace the loose badge list with the nine-category table from the repository template, using the shared palette, a padlock for the security policy, and a download glyph for PyPI downloads.
Add the badge to the Community row, next to the contributing guide, the code of conduct, and the security policy. The repository already requires the format in CONTRIBUTING and release-please consumes it.
Replace black, isort, flake8 and its plugins with Ruff for both linting and formatting. Add the Ruff configuration to pyproject.toml, replace the flake8 and format tox environments with lint, format and format-check, and switch the pre-commit hooks to ruff check and ruff format. Tests are exempt from the docstring and line length rules.
Apply ruff format and the safe ruff check fixes (import order, unused imports) to the package and the tests. Also remove four duplicated test functions in the service tests (exports, flow share, impact share and imports) that were silently shadowed by an identical later definition (F811).
Fix the poetry install command in CONTRIBUTING.md now that the format group no longer exists, correct the scope in SECURITY.md that named wattnet-storage instead of wattnet-api, and normalize the wording of the pull request and issue templates. Use two-space indentation in dependabot.yml and remove em dashes from the README.
@codecov

codecov Bot commented Oct 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@jaimeib
jaimeib merged commit cbdca63 into main Oct 27, 2026
9 checks passed
@jaimeib
jaimeib deleted the chore/ruff-and-badges branch October 27, 2026 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant