Skip to content

chore(lint): Enable Pyflakes rules across all packages#497

Open
ayushiahjolia wants to merge 1 commit into
mainfrom
enable-pyflakes-lint
Open

chore(lint): Enable Pyflakes rules across all packages#497
ayushiahjolia wants to merge 1 commit into
mainfrom
enable-pyflakes-lint

Conversation

@ayushiahjolia

Copy link
Copy Markdown
Contributor

Issue #, if available: #479

Description of changes:
Enables the Pyflakes (F) rule category in ruff across all packages. reviously only TID252 (ban relative imports) was enforced, meaning unused imports, undefined names, and unused variables went undetected.

Testing -

  • ci-checks.sh passes (tests, coverage, typecheck, fmt for all packages)
  • ruff check --select F,TID252 reports zero violations

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@ayushiahjolia ayushiahjolia force-pushed the enable-pyflakes-lint branch 2 times, most recently from 976823e to 8a0fcc9 Compare June 30, 2026 03:18
@ayushiahjolia ayushiahjolia marked this pull request as ready for review June 30, 2026 03:32
Comment thread packages/aws-durable-execution-sdk-python-examples/cli.py
[tool.ruff.lint]
preview = true
select = ["TID252"] # Enforce absolute imports (ban relative imports)
select = ["F", "TID252"] # Pyflakes (unused imports, undefined names, etc.) + absolute imports

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused imports in Python might be actually used because the imported symbols may not be used in the current module, instead be used by other modules importing this module

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm I relied on tests to verfify this, I found one variable which was used at runtime, but no other issues.

@yaythomas

Copy link
Copy Markdown
Contributor

d238353 "update ruff config" added: +select = ["TID252"] # Enforce absolute imports (ban relative imports)

This is the regression point. Adding TID252 as the sole entry overrode the default and silently switched off F (and the E4/E7/E9 subset). From here, unused imports/vars accumulated undetected.

The PR could optionally also restore E4/E7/E9 (the rest of the old default) via select = ["E4","E7","E9","F","TID252"], since those were dropped in the same commit.

And a minor pre-existing inconsistency: the testing package sets preview = false while the others set preview = true. Not necessarily in scope for this PR :-)

@ayushiahjolia ayushiahjolia force-pushed the enable-pyflakes-lint branch from 8a0fcc9 to 7247180 Compare July 8, 2026 19:14
@ayushiahjolia ayushiahjolia force-pushed the enable-pyflakes-lint branch from 7247180 to d29e7c4 Compare July 9, 2026 04:57
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.

4 participants