Skip to content

New class_equals_linter #989

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 6 commits into from
Mar 25, 2022
Merged

New class_equals_linter #989

merged 6 commits into from
Mar 25, 2022

Conversation

MichaelChirico
Copy link
Collaborator

Part of #962

@AshesITR
Copy link
Collaborator

I've also seen switch(class(x), ...) in the wild; sometimes switch(mode(x), ...) is appropriate and sometimes an if ... else if ... chain.
IINM, mode(x) is at least guaranteed to be a scalar.

@MichaelChirico
Copy link
Collaborator Author

awesome, great idea!

let's mark extensions like this as new issues for now -- once we have all the linters imported for #962, we can do another round of triage to see what's worth implementing in time for 3.0.0

#' @export
class_equals_linter <- function() {
Linter(function(source_file) {
if (length(source_file$parsed_content) == 0L) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should check for xml_parsed_content since it requires XML

@MichaelChirico MichaelChirico merged commit 863de33 into master Mar 25, 2022
@MichaelChirico MichaelChirico deleted the class_equals branch March 25, 2022 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants