Skip to content

New class_equals_linter - #989

Merged
MichaelChirico merged 6 commits into
masterfrom
class_equals
Mar 25, 2022
Merged

MichaelChirico merged 6 commits into
masterfrom
class_equals

Conversation

@MichaelChirico

Copy link
Copy Markdown
Collaborator

Part of #962

@AshesITR

Copy link
Copy Markdown
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
Copy Markdown
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

Comment thread R/class_equals_linter.R Outdated
#' @export
class_equals_linter <- function() {
Linter(function(source_file) {
if (length(source_file$parsed_content) == 0L) {

Copy link
Copy Markdown
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