-
Notifications
You must be signed in to change notification settings - Fork 195
Lint identical(x, sort(x)) in sort_linter()
#2921
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2921 +/- ##
=======================================
Coverage 99.24% 99.24%
=======================================
Files 129 129
Lines 7282 7301 +19
=======================================
+ Hits 7227 7246 +19
Misses 55 55 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| parent::expr[not(SYMBOL_SUB)] | ||
| /parent::expr[ | ||
| expr/SYMBOL_FUNCTION_CALL[text() = 'identical'] | ||
| and expr/expr = expr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may need more baroque handling here, a la #2901 and strip_comments_from_subtree(). Try test cases like:
identical(x, sort( # comment
x
))
identical(foo(x), sort(foo( # comment
x
)))
I initially tried to re-use the existing
sorted_xpathbut I think customizing the error message was then too messy and unclear.Fix #2908