Skip to content

SONARPY-4539 FP: S1313 should not report version values assigned to __version__ - #2300

Closed
erwan-leforestier-sonarsource wants to merge 5 commits into
masterfrom
fix/sonarpy-4539-ignore-version-ip-values
Closed

SONARPY-4539 FP: S1313 should not report version values assigned to __version__#2300
erwan-leforestier-sonarsource wants to merge 5 commits into
masterfrom
fix/sonarpy-4539-ignore-version-ip-values

Conversation

@erwan-leforestier-sonarsource

Copy link
Copy Markdown
Contributor

Summary

Avoid false positives by treating IPv4-shaped literals assigned directly to the Python version variable as package versions.

Changes

  • Detect direct standard and annotated version assignments in S1313
  • Preserve reporting for ordinary, uppercase, and chained assignments
  • Add regression coverage for direct and parenthesized version literals

@erwan-leforestier-sonarsource
erwan-leforestier-sonarsource marked this pull request as ready for review August 19, 2026 09:07
@gitar-bot

gitar-bot Bot commented Aug 19, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Updates rule S1313 to ignore IPv4-shaped literal values assigned to version variables, eliminating false positives on package versions. No issues found.

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

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