Replace flake8/black/isort/pyupgrade with ruff #3

Merged
johnpreston merged 2 commits from chore/ruff-linting into chore/tooling-refresh 2026-09-14 12:50:08 +00:00
Owner

ruff 0.16.6 for both linting (E,F,W,I,UP,B,C4,SIM,RUF; E501 ignored for long ARN regex literals; keep-runtime-typing preserved to match the old pyupgrade flag) and formatting.

Fixes applied along the way:

  • 40 implicit-Optional parameters (RUF013), PEP604 unions in future-annotations modules (UP007)
  • loop-variable shadowing in ECS describe chunking (B020)
  • warnings stacklevel (B028), raise-from in test_arns (B904)
  • keyisset/keypresent return conditions simplified (SIM103/SIM118)
  • module docstring placement in aws/init.py (E402)
  • unused imports/variables, dict.get key checks (RUF019)

Wiring: pre-commit ruff-check + ruff-format hooks (rev pinned to the dev dependency), Makefile lint/conform ruff-based, .flake8 and [tool.black]/[tool.isort] dropped, flake8/black/isort/pyupgrade/flake8-docstrings removed from dev deps.

Verified: ruff check + format clean; 36 passed / 3 deselected (broken tests fixed in the next PR).

ruff 0.16.6 for both linting (E,F,W,I,UP,B,C4,SIM,RUF; E501 ignored for long ARN regex literals; keep-runtime-typing preserved to match the old pyupgrade flag) and formatting. Fixes applied along the way: - 40 implicit-Optional parameters (RUF013), PEP604 unions in future-annotations modules (UP007) - loop-variable shadowing in ECS describe chunking (B020) - warnings stacklevel (B028), raise-from in test_arns (B904) - keyisset/keypresent return conditions simplified (SIM103/SIM118) - module docstring placement in aws/__init__.py (E402) - unused imports/variables, dict.get key checks (RUF019) Wiring: pre-commit ruff-check + ruff-format hooks (rev pinned to the dev dependency), Makefile lint/conform ruff-based, .flake8 and [tool.black]/[tool.isort] dropped, flake8/black/isort/pyupgrade/flake8-docstrings removed from dev deps. Verified: ruff check + format clean; 36 passed / 3 deselected (broken tests fixed in the next PR).
- ruff 0.16.6 for linting (E,F,W,I,UP,B,C4,SIM,RUF) and formatting;
  E501 ignored for long ARN regex literals, keep-runtime-typing
  preserved to match the historical pyupgrade pre-commit setting
- Fix findings: implicit Optional params (RUF013), PEP604 unions in
  future-annotations modules (UP007), loop-var shadowing in ecs
  describe_tasks/describe_container_instances chunks (B020),
  warnings stacklevel (B028), needless bool returns in keyisset/
  keypresent (SIM103/SIM118), dict.get key checks (RUF019), raise
  from in test_arns (B904), unused imports/variables, module
  docstring placement in aws/__init__.py (E402)
- pre-commit: ruff-check + ruff-format hooks replace black/isort/
  pyupgrade; Makefile lint/conform now ruff-based; .flake8 dropped
- black, isort, pyupgrade, flake8, flake8-docstrings removed from
  dev dependencies
Fix broken route53/vpc tests: mock pagination, drop AWS-hitting strays (#4)
All checks were successful
CI / Lint (ruff) (pull_request) Successful in 28s
CI / Tests (Python 3.10) (pull_request) Successful in 2m5s
CI / Tests (Python 3.11) (pull_request) Successful in 1m56s
CI / Tests (Python 3.12) (pull_request) Successful in 1m58s
CI / Tests (Python 3.13) (pull_request) Successful in 1m57s
CI / Docs build (pull_request) Successful in 2m22s
CI / Package build (pull_request) Successful in 2m1s
CI / Tests (Python 3.14) (pull_request) Successful in 1m30s
eba90869f2
- test_aws_route53: placebos were never committed (test left in **record** mode, playback commented out) -- replaced with mocked boto3 client pagination tests for list_all_hosted_zones/list_all_records, asserting markers and kwargs across pages
- test_aws_vpc: removed session-less list_all_vpcs()/list_all_subnets() calls that hit real AWS before the playback part; playback tests now assert (3 VPCs; subnet test asserts count -- placebo replays GetResource in recorded order and the first files are VPC recordings, noted in a comment)
- Added mocked pagination tests for list_all_vpcs/list_all_subnets

Suite fully green: **44 passed**, no CI deselects needed.

Co-authored-by: John M <john@ews-network.net>
Reviewed-on: #4
johnpreston merged commit 1c6a377632 into chore/tooling-refresh 2026-09-14 12:50:08 +00:00
Sign in to join this conversation.
No reviewers
No labels
ci::lib
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
compose-x/compose-x-common!3
No description provided.