Skip to content

chore: enable PIE (flake8-pie) ruff rule#5150

Open
ogulcanaydogan wants to merge 3 commits into
open-telemetry:mainfrom
ogulcanaydogan:chore/enable-ruff-pie-rule
Open

chore: enable PIE (flake8-pie) ruff rule#5150
ogulcanaydogan wants to merge 3 commits into
open-telemetry:mainfrom
ogulcanaydogan:chore/enable-ruff-pie-rule

Conversation

@ogulcanaydogan
Copy link
Copy Markdown

Part of #4227

Adds PIE to the ruff lint select list and fixes all violations.

What changed

  • pyproject.toml: added "PIE" to [tool.ruff.lint] select
  • Fixed 49 auto-fixable violations across 20 files:
    • PIE790 – removed unnecessary pass statements in exception handlers
    • PIE804 – replaced dict(key=value) with {"key": value} literals
    • PIE808 – removed redundant start=0 argument from range() calls
  • Added # noqa: PIE796 on GenAiTokenTypeValues.COMPLETION in gen_ai_attributes.py — this is an intentional deprecated alias sharing the same enum value as OUTPUT

Testing

ruff check .   # All checks passed

@github-project-automation github-project-automation Bot moved this to Approved PRs in Python PR digest Apr 27, 2026
@ogulcanaydogan
Copy link
Copy Markdown
Author

Thanks for the review @DylanRussell! Could a project member take a look when you have a moment? All checks are green.

@ogulcanaydogan
Copy link
Copy Markdown
Author

ogulcanaydogan commented May 1, 2026

Friendly bump @DylanRussell has approved and CI is green. Would appreciate a maintainer review when you have a moment. @srikanthccv @aabmass

@ogulcanaydogan ogulcanaydogan force-pushed the chore/enable-ruff-pie-rule branch 2 times, most recently from 261560f to 7b6dbb7 Compare May 8, 2026 11:05
@ogulcanaydogan ogulcanaydogan force-pushed the chore/enable-ruff-pie-rule branch 2 times, most recently from cac4933 to 8ea69ce Compare May 12, 2026 08:29
@ogulcanaydogan ogulcanaydogan force-pushed the chore/enable-ruff-pie-rule branch from 8ea69ce to 15a5193 Compare May 12, 2026 19:22
@emdneto
Copy link
Copy Markdown
Member

emdneto commented May 12, 2026

Thanks for the PR!

Just a heads-up: we no longer update CHANGELOG.md directly. The changelog is now generated from changelog fragments using Towncrier.

Please add the appropriate changelog fragment for this change instead of editing CHANGELOG.md manually. You can find the instructions and expected format in CONTRIBUTING.md.

Part of open-telemetry#4227

Adds `PIE` to the ruff lint select list. Fixes all 49 auto-fixable
violations (PIE790 unnecessary pass, PIE804 unnecessary dict kwargs,
PIE808 unnecessary range start argument). Suppresses PIE796 on
GenAiTokenTypeValues.COMPLETION which is an intentional deprecated alias
for OUTPUT sharing the same enum value.
@ogulcanaydogan ogulcanaydogan force-pushed the chore/enable-ruff-pie-rule branch from 15a5193 to ddec690 Compare May 13, 2026 11:38
@ogulcanaydogan
Copy link
Copy Markdown
Author

@MikeGoldsmith @emdneto thanks for the approvals. The fork PR workflows still need a maintainer to authorize the run, whenever convenient.

Copy link
Copy Markdown
Member

@emdneto emdneto left a comment

Choose a reason for hiding this comment

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

Please add the appropriate changelog fragment for this change instead of editing CHANGELOG.md manually. You can find the instructions and expected format in CONTRIBUTING.md.

@emdneto emdneto moved this from Approved PRs to Approved PRs that need fixes in Python PR digest May 14, 2026
Signed-off-by: Ogulcan Aydogan <ogulcanaydogan@hotmail.com>
Signed-off-by: Ogulcan Aydogan <ogulcanaydogan@hotmail.com>
@ogulcanaydogan ogulcanaydogan force-pushed the chore/enable-ruff-pie-rule branch from ddec690 to 6a4a576 Compare May 14, 2026 10:47
@ogulcanaydogan
Copy link
Copy Markdown
Author

Thanks for the heads-up! Replaced the direct CHANGELOG.md edit with a Towncrier fragment at .changelog/5150.changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Approved PRs that need fixes

Development

Successfully merging this pull request may close these issues.

4 participants