From 246207e310f5d0b51f8f96bd0406c23ba4c8d9a5 Mon Sep 17 00:00:00 2001 From: Indrajeet Patil Date: Thu, 5 Dec 2024 01:26:12 +0530 Subject: [PATCH] Update indentation_linter.R --- R/indentation_linter.R | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/R/indentation_linter.R b/R/indentation_linter.R index 2e9bf3822..de4a7c777 100644 --- a/R/indentation_linter.R +++ b/R/indentation_linter.R @@ -257,9 +257,12 @@ indentation_linter <- function(indent = 2L, hanging_indent_style = c("tidy", "al } # Only lint non-empty lines if the indentation level doesn't match. + # TODO: remove styler ignore directives once tidyverse/style/issues/197 is resolved + # styler: off bad_lines <- which(indent_levels != expected_indent_levels & - nzchar(trimws(source_expression$file_lines)) & - !in_str_const) + nzchar(trimws(source_expression$file_lines)) & + !in_str_const) + # styler: on if (length(bad_lines) > 0L) { # Suppress consecutive lints with the same indentation difference, to not generate an excessive number of lints is_consecutive_lint <- c(FALSE, diff(bad_lines) == 1L)