Skip to content
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

handle empty arguments in switch statements #499

Merged
merged 5 commits into from
Jun 23, 2020

Conversation

markromanmiller
Copy link
Contributor

I've noticed that there was a conflict between the comma spacing linter and the infix operator linter when using switch statements that have fall-through arguments like switch(foo, x = , y = bar, z = baz). If there is a space in the x argument between the = and the ,, then the comma spacing linter complains; if there is no space there the infix operator linter complains.

I consulted the vctrs documentation here (because that's what originally made me use switch) and saw it was written with the space, so I modified the comma linter to allow these types of lines.

I'm happy to take feedback on my approach; I'm not too confident using base R.

@jimhester
Copy link
Member

Looks good to me, can you please add a bullet to NEWS? It should briefly describe the change and end with (@yourname, #issuenumber).

@markromanmiller
Copy link
Contributor Author

Changes made! Thanks.

@jimhester
Copy link
Member

Thanks for working on this!

Thanks!

After your first merged pull request you are automatically invited as a contributor to the lintr project. See #318 (comment) for details on what you can do as a contributor.

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.

2 participants