-
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
Conflicting lintr rules with alist and explicitly missing arguments #540
Labels
false-positive
code that shouldn't lint, but does
Comments
This is related to #532 |
Ah, I'd looked though for issues about commas but managed to miss that! |
Your examples show that the |
Is this in fact the same as #532? |
This is basically the same as #708 -- there, we now allow your second usage, but not your first: lintr::lint("switch(a = , b = 2)\n") # doesn't lint
lintr::lint("switch(a =, b = 2)\n")
# <text>:1:10: style: [infix_spaces_linter] Put spaces around all infix operators.
# switch(a =, b = 2)
# ^ This aligns with {styler}: styler::style_text("switch(a = , b = 2)\nswitch(a =, b = 2)\nalist(a = )\nalist(a =)")
# switch(a = ,
# b = 2
# )
# switch(a = ,
# b = 2
# )
# alist(a = )
# alist(a = ) |
MichaelChirico
added
false-positive
code that shouldn't lint, but does
and removed
bug
an unexpected problem or unintended behavior
labels
Oct 8, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is pretty niche but shows up a conflicting pair of rules:
So for arguments that are "explicitly missing" there is no way of satisfying the default set of linter rules - we must and cannot have a space following the
=
, for cases that are within or at the end of an argument list.The above behaviour is triggered in both the cran version (2.0.1) and current github (2.0.1.9000, eece3c1)
The text was updated successfully, but these errors were encountered: