Skip to content

Conversation

Bisaloo
Copy link
Collaborator

@Bisaloo Bisaloo commented Aug 5, 2025

I initially tried to re-use the existing sorted_xpath but I think customizing the error message was then too messy and unclear.

Fix #2908

Copy link

codecov bot commented Aug 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.24%. Comparing base (2b70b52) to head (7a0a14b).

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.
📢 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.


# expression matching
expect_lint("sort(foo(x)) == foo(x)", sorted_msg, linter)
expect_lint("identical(foo(x), sort(foo(x)))", sorted_msg, linter)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's add some more tests against false positives, like identical(sort(x), y), identical(sort(foo(x)), x), and a test that this catches expressions: identical(sort(foo(x)), foo(x))

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.

Recommend !is.unsorted() instead of identical(x, sort(x)) in sort_linter()
2 participants