lintr icon indicating copy to clipboard operation
lintr copied to clipboard

Lint if (FALSE) / while (FALSE) snippets through commented_code_linter?

Open MichaelChirico opened this issue 3 years ago • 2 comments

Such code is effectively commented code, right?

MichaelChirico avatar Jun 22 '22 15:06 MichaelChirico

Seems like a better fit for unreachable_code_linter() to me. But yes, should be linted.

AshesITR avatar Jun 22 '22 21:06 AshesITR

Yeah, I agree that this will be more suitable for inclusion in unreachable_code_linter().

if (FALSE) or while (FALSE) is a valid use in Roxygen comments for examples that shouldn't be run during CRAN checks. But this shouldn't be an issue since (IINM) we don't lint Roxygen comments anyway.

IndrajeetPatil avatar Jul 27 '22 06:07 IndrajeetPatil

if (FALSE) or while (FALSE) is a valid use in Roxygen comments

Disagree btw -- that's what \dontrun{} is for :)

MichaelChirico avatar Sep 09 '23 07:09 MichaelChirico