Skip to content
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

Support pattern-based exclusion in return_linter() #2433

Merged
merged 13 commits into from
Dec 15, 2023
Merged

Conversation

MichaelChirico
Copy link
Collaborator

Closes #2335.

Implementation is maybe not ideal since it requires running the //FUNCTION | //OP-LAMBDA XPath twice -- once to find the names of assigned functions, a second time to check for lints.

The workaround I could think of was to (1) find all //FUNCTION | //OP-LAMBDA nodes (2) partition into assigned vs. unassigned (3) trim except|except_regex from the assigned group (4) combine_nodesets() (4) check for lints. But IINM this would require refactoring a lot of other code as well, I'm not sure it's worth it -- //FUNCTION | //OP-LAMBDA should be relatively fast.

R/return_linter.R Outdated Show resolved Hide resolved
R/return_linter.R Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Dec 14, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (c912988) 98.53% compared to head (210bfaa) 98.53%.

❗ Current head 210bfaa differs from pull request most recent head 586ab3b. Consider uploading reports for the commit 586ab3b to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2433   +/-   ##
=======================================
  Coverage   98.53%   98.53%           
=======================================
  Files         126      126           
  Lines        5659     5670   +11     
=======================================
+ Hits         5576     5587   +11     
  Misses         83       83           

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

R/return_linter.R Outdated Show resolved Hide resolved
R/return_linter.R Outdated Show resolved Hide resolved
@AshesITR
Copy link
Collaborator

Very nice feature - makes the linter much more attractive for larger code bases.

@AshesITR AshesITR merged commit 5b99e6e into main Dec 15, 2023
21 checks passed
@MichaelChirico MichaelChirico deleted the return-except-regex branch December 27, 2023 09:17
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.

Extend return_linter to allow prefix exclusions
4 participants