ITADN

Don't require "nested" indentation for multiline formulas?

#2996OpenThomasSoeiro 创建于 2025-12-19
indentation 📏
T
ThomasSoeirocommented
First, thank you for this very useful package! Is the following lint intended? ```r txt <- " y ~ var_1 + var_2 + var_3 " lintr::lint( txt, linters = lintr::linters_with_defaults(), parse_settings = FALSE ) #> <text>:4:2: style: [indentation_linter] Indentation should be 4 spaces but is 2 spaces. #> var_2 + #> ^~~ ``` `lintr` currently expects a "nested" indentation: ```r txt <- " y ~ var_1 + var_2 + var_3 " lintr::lint( txt, linters = lintr::linters_with_defaults(), parse_settings = FALSE ) #> ℹ No lints found. ``` I think it is suboptimal because there is no "hierarchy" between the variables. FWIW, there have been similar discussions for air here: https://github.com/posit-dev/air/issues/444.
4 条评论