Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Lint empty curly braces with spaces and/or line-breaks #2668

Open
IndrajeetPatil opened this issue Oct 2, 2024 · 1 comment
Open

Lint empty curly braces with spaces and/or line-breaks #2668

IndrajeetPatil opened this issue Oct 2, 2024 · 1 comment
Labels
feature a feature request or enhancement

Comments

@IndrajeetPatil
Copy link
Collaborator

cf. https://style.tidyverse.org/syntax.html?q=empty%20curly%20braces#indenting

library(lintr)

lint(
  text = "while (waiting_for_something()) { }",
  linters = all_linters()
)
#> ℹ No lints found.

lint(
  text = "while (waiting_for_something()) {

}",
  linters = all_linters()
)
#> ℹ No lints found.

Created on 2024-10-02 with reprex v2.1.1

Instead of no lint, the {lintr} should recommend:

while (waiting_for_something()) {}
@IndrajeetPatil
Copy link
Collaborator Author

Ideally, {styler} takes care of this r-lib/styler#1232

@IndrajeetPatil IndrajeetPatil added the feature a feature request or enhancement label Oct 3, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
feature a feature request or enhancement
Projects
None yet
Development

No branches or pull requests

1 participant