Skip to content

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

Open
ogulcanaydogan wants to merge 2 commits intoopen-telemetry:mainfrom
ogulcanaydogan:chore/enable-ruff-pie-rule
Open

chore: enable PIE (flake8-pie) ruff rule#5150
ogulcanaydogan wants to merge 2 commits intoopen-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

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.
@github-project-automation github-project-automation Bot moved this to Approved PRs in Python PR digest Apr 27, 2026
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

Development

Successfully merging this pull request may close these issues.

2 participants