Skip to content

Add linter_level Attribute to Linter() #2352

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

Merged
merged 7 commits into from
Nov 24, 2023
Merged

Conversation

AshesITR
Copy link
Collaborator

fixes #2351

system.time(lint_package())

# here
#   user  system elapsed 
# 76.062   0.196  76.302 

# main
#   user  system elapsed 
# 85.855   0.126  86.092 

@MichaelChirico
Copy link
Collaborator

FYI I won't be available for detailed review for some days

@AshesITR
Copy link
Collaborator Author

Thanks for the heads-up

@codecov-commenter
Copy link

codecov-commenter commented Nov 24, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (9e5b4ac) 99.41% compared to head (144bad1) 99.41%.

❗ Current head 144bad1 differs from pull request most recent head 9022725. Consider uploading reports for the commit 9022725 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2352   +/-   ##
=======================================
  Coverage   99.41%   99.41%           
=======================================
  Files         124      124           
  Lines        5642     5654   +12     
=======================================
+ Hits         5609     5621   +12     
  Misses         33       33           

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

Copy link
Collaborator

@IndrajeetPatil IndrajeetPatil left a comment

Choose a reason for hiding this comment

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

This looks great! Definitely an appreciable speed-up.

(I've a nitpicky comment, but don't feel strongly either way.)

@AshesITR AshesITR merged commit 828bb9c into main Nov 24, 2023
@AshesITR AshesITR deleted the feature/2351-lint-level branch November 24, 2023 18:49
if (!is.function(fun) || length(formals(args(fun))) != 1L) {
stop("`fun` must be a function taking exactly one argument.", call. = FALSE)
}
linter_level <- match.arg(linter_level)
Copy link
Collaborator

Choose a reason for hiding this comment

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

NB:

match.arg(NA, NA_character_)
# Error in match.arg(NA, NA_character_) : 
#   'arg' must be NULL or a character vector

Maybe match.arg(as.character(linter_level)) is better?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Note that can omit linter_level= if you want NA. But yes, would be nicer to allow logical NA as well.

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.

Add linter_level to Linter() metadata.
4 participants