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

indentation_linter() conflicts with {styler} #1898

Closed
IndrajeetPatil opened this issue Jan 11, 2023 · 1 comment · Fixed by #1948
Closed

indentation_linter() conflicts with {styler} #1898

IndrajeetPatil opened this issue Jan 11, 2023 · 1 comment · Fixed by #1948

Comments

@IndrajeetPatil
Copy link
Collaborator

I am not sure if this is the same as tidyverse/style#197, but here is another instance where indentation_linter() lints code that {styler} thinks is in line with the tidyverse style guide:

library(lintr)

"out <- data.frame(.ci_generic(x,
  ci = ci,
  ...
))" -> code

# styler won't change this code
styler::style_text(code)
#> out <- data.frame(.ci_generic(x,
#>   ci = ci,
#>   ...
#> ))

# but lintr will lint this code
lint(text = code, linters = indentation_linter())
#> <text>:2:2: style: [indentation_linter] Indentation should be 20 spaces but is 2 spaces.
#>   ci = ci,
#>  ^~~~~~~~~~

Created on 2023-01-11 with reprex v2.0.2

@AshesITR
Copy link
Collaborator

I think this might be a bug. What's the behavior with only one call?
IINM, that would be acceptable tidyverse indentation style for multi-line function calls.

IndrajeetPatil added a commit to easystats/workflows that referenced this issue Jan 20, 2023
@IndrajeetPatil IndrajeetPatil mentioned this issue Apr 3, 2023
14 tasks
@MichaelChirico MichaelChirico added this to the 3.1.0 milestone Apr 4, 2023
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 a pull request may close this issue.

3 participants