Skip to content

Conversation

MIXgleb
Copy link
Contributor

@MIXgleb MIXgleb commented May 27, 2025

I have made things!

  • Improves WPS349 RedundantSubscriptViolation highlighting: now a specific slice index is highlighted, not the entire slice;
if not lower_ok:
    self.add_violation(
        consistency.RedundantSubscriptViolation(node.slice.lower)
    )

if not upper_ok:
    self.add_violation(
        consistency.RedundantSubscriptViolation(node.slice.upper)
    )

if not step_ok:
    self.add_violation(
        consistency.RedundantSubscriptViolation(node.slice.step)
    )

instead of

if not (lower_ok and upper_ok and step_ok):
    self.add_violation(
        consistency.RedundantSubscriptViolation(node)
    )

I find it more appropriate to specify which index contains the redundant grammar

Checklist

  • I have double checked that there are no unrelated changes in this pull request (old patches, accidental config files, etc)
  • I have created at least one test case for the changes I have made
  • I have updated the documentation for the changes I have made
  • I have added my changes to the CHANGELOG.md

Copy link

codecov bot commented May 27, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (7b83f78) to head (20243a8).
⚠️ Report is 65 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #3437   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          362       362           
  Lines        11968     11987   +19     
  Branches       818       821    +3     
=========================================
+ Hits         11968     11987   +19     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@MIXgleb MIXgleb force-pushed the WPS349-highlighting branch 2 times, most recently from 5a92f9f to 176b920 Compare May 28, 2025 08:43
Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

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

On the other hand - why not? It is better to the user to see what index is wrong exactly. Please, add a test with 2 and 3 wrong indexes.

@MIXgleb MIXgleb force-pushed the WPS349-highlighting branch from 176b920 to 20243a8 Compare May 29, 2025 14:25
@MIXgleb
Copy link
Contributor Author

MIXgleb commented May 29, 2025

that's exactly what my idea was to improve visibility))

Extra tests have been added.

Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

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

Thanks!

@sobolevn sobolevn merged commit 7cce069 into wemake-services:master May 29, 2025
9 checks passed
@MIXgleb MIXgleb deleted the WPS349-highlighting branch May 29, 2025 18:10
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.

2 participants