Repository navigation
add name attribute to Linter class - #753
Merged
Merged
Conversation
AshesITR
marked this pull request as draft
February 13, 2021 15:15
make expect_lint() resilient to complete removal of the argument
AshesITR
marked this pull request as ready for review
February 13, 2021 21:44
| function(id) { | ||
|
|
||
| parsed <- source_file$parsed_content[id, ] | ||
| parsed <- source_file$parsed_content[id,] |
Collaborator
There was a problem hiding this comment.
the lint is correct, isn't it?
|
|
||
| linter_auto_name <- function(which = -3L) { | ||
| call <- sys.call(which = which) | ||
| nm <- paste(deparse(call, 500L), collapse = "") |
Collaborator
There was a problem hiding this comment.
collapse should be " " IINM
| if (inherits(x, "linter")) { | ||
| attr(x, "name", exact = TRUE) | ||
| } else { | ||
| paste(deparse(x, 500L), collapse = "") |
|
|
||
| expect_warning( | ||
| Lint("dummy.R", linter = "deprecated"), | ||
| fixed = "deprecated" |
Collaborator
There was a problem hiding this comment.
isn't fixed the argument passed to grepl?
Collaborator
Author
There was a problem hiding this comment.
Yep, the warning should contain the text "deprecated", no?
Collaborator
There was a problem hiding this comment.
then fixed=TRUE and I think warning="deprecated" if you want to name it right?
Collaborator
Author
There was a problem hiding this comment.
Oh, thanks for pointing that out.
We have a lot of these calls in test-lint_file.R
MichaelChirico
requested changes
Feb 15, 2021
MichaelChirico
left a comment
Collaborator
There was a problem hiding this comment.
Basically looks good, small changes
fix test expectation
MichaelChirico
approved these changes
Feb 16, 2021
MichaelChirico
added a commit
that referenced
this pull request
Feb 17, 2021
* add name attribute to Linter class fixes #746 * fix test failures * document() * restore 100% coverage for utils.R * deprecate Lint(linter = ...) and remove all calling instances make expect_lint() resilient to complete removal of the argument * add NEWS bullet * document() * fix lint, collapse with space fix test expectation Co-authored-by: Michael Chirico <[email protected]>
MichaelChirico
added a commit
that referenced
this pull request
Feb 17, 2021
* add name attribute to Linter class fixes #746 * fix test failures * document() * restore 100% coverage for utils.R * deprecate Lint(linter = ...) and remove all calling instances make expect_lint() resilient to complete removal of the argument * add NEWS bullet * document() * fix lint, collapse with space fix test expectation Co-authored-by: Michael Chirico <[email protected]>
AshesITR
added a commit
that referenced
this pull request
Feb 18, 2021
* initial formalization of Russ's branch comparison script * tweaks * tweak again * debugging * workaround for Depends * more tweak * skip empty depends * add to buildignore * use optparse * consolidate TODO * add name attribute to Linter class (#753) * add name attribute to Linter class fixes #746 * fix test failures * document() * restore 100% coverage for utils.R * deprecate Lint(linter = ...) and remove all calling instances make expect_lint() resilient to complete removal of the argument * add NEWS bullet * document() * fix lint, collapse with space fix test expectation Co-authored-by: Michael Chirico <[email protected]> * typo in optparse funciton skip Depends except on object_usage_linter typo need check higher up forgot to supply arg just exit early if Depends unavailable provide an interactive() experience for debugging tweak * add name attribute to Linter class (#753) * add name attribute to Linter class fixes #746 * fix test failures * document() * restore 100% coverage for utils.R * deprecate Lint(linter = ...) and remove all calling instances make expect_lint() resilient to complete removal of the argument * add NEWS bullet * document() * fix lint, collapse with space fix test expectation Co-authored-by: Michael Chirico <[email protected]> * typo * vestigial variable name not working from command line testing more debugging Rscript sucks progress -- we need to skip missing Imports too more progress -- skip on platforms without tcl/tk need testing again need to exit early * skip directories with encoding issues * switch conditions * remove tracing Co-authored-by: AshesITR <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #746
Things that should be done in this PR:
linterargument fromLint. It's overwritten duringlint()anyway.expect_lint()to nevertheless recognizelinteras alint_fieldsdespite not being an argument ofLint().