-
Notifications
You must be signed in to change notification settings - Fork 186
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
Make scalar_in_linter()
configurable
#2574
Merged
Merged
Changes from 2 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
60869ce
Update scalar_in_linter.R (#1)
F-Noelle b38f100
Incorporate review feedback (#2)
F-Noelle 39a9c02
Add a vector of in operators (#3)
F-Noelle ae58e20
Merge branch 'main' into main
F-Noelle 7bd8324
Add a testcase based on configuration (#4)
F-Noelle b756379
Merge branch 'r-lib:main' into main
F-Noelle 3f5eb7c
Improve lint message, NEWS, param documentation (#5)
F-Noelle 04881ef
Improve lint message (#6)
F-Noelle 49c453e
Update R/scalar_in_linter.R
F-Noelle 1aa6491
Update lint message (#7)
F-Noelle File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
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.
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.
Since the default argument is
NULL
for this parameter, the second sentence is no longer needed here.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.
The linter previously did lint the
%chin%
in its unconfigurable state. As this is no longer the case due to the default changing to NULL this is a notable change. If there is a better way to phrase that I am all ears.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.
The larger point of the change you are making is allowing to configure this linter.
%chin%
was just your use case, and the developers who are reading this NEWS item don't need to know that. For users of some other package, it would have been a different operator (say%nin%
).I personally don't use
{data.table}
much, so I wasn't even aware of this infix operator; as a result, this part of the NEWS item was confusing for me because I thought this was an operator in base that I didn't know about.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.
So you might misunderstand something here.
%chin%
was never my use case. I know of{data.tables}
, but never used it in any of my projects. I just through it would be easy to make this linter configurable to work with my use cases, hence the pull request.Previously the linter in its unconfigurable form linted
%in%
and%chin%
, nothing else. When I made the update I wanted to make it backwards compatible to its original use case, so I opted to make%chin%
the default for the new parameter.@MichaelChirico then suggested to demote
%chin%
from its special status making this PR a breaking change, which I am completely on board with. But having a breaking change is NEWS worthy in my opinion, because people might have relied on the old behaviour aka%chin%
being linted.As this is no longer the case I want to highlight that simple fact as part of the NEWS. Just because I don't rely on it doesn't mean that nobody else did. If there is a better way of phrasing this I am all ears.
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.
I have nothing more to add here over my previous reply.
I will let @MichaelChirico decide the best phrasing for this news item, if he thinks it merits being phrased differently.
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.
If we do make a breaking change, the corresponding bullet should be in its own section to highlight the change more clearly.
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.
I agree with @F-Noelle about the NEWS item, it looks good to me. Maybe we can emphasize better that it's a {data.table} operator.
@IndrajeetPatil see here, I'm not quite sure your point:
lintr/R/scalar_in_linter.R
Line 35 in fc2268f
main
,x %chin% 'a'
will lintx %chin% 'a'
will only lint underscalar_in_linter("%chin%")
or similar.