Skip to content

Comments

Fix # nolint flag linter exclusion syntax#263

Merged
joshwlambert merged 3 commits intomainfrom
nolint-flags
Nov 20, 2025
Merged

Fix # nolint flag linter exclusion syntax#263
joshwlambert merged 3 commits intomainfrom
nolint-flags

Conversation

@joshwlambert
Copy link
Member

@joshwlambert joshwlambert commented Nov 20, 2025

This PR fixes the syntax of # nolint flags in the code that specify a specific linter to exclude for that line or chunk of lines. Previously, the linter wanting to be excluded was specified but not recognised by {lintr} due to not using the # nolint: linter_name, linter2_name. syntax, specifically not using a colon or full stop. See https://lintr.r-lib.org/reference/exclude.html.

The specific linter being excluded has been removed from # nolint end statements as it is not required, see https://lintr.r-lib.org/articles/lintr.html#excluding-multiple-lines-of-codes.

Lines that had a # nolint flag that caused the line to exceed 80 characters have been converted into # nolint start and # nolint end statements, to avoid having to also specify the line_length_linter, making that line of code exceedingly long.

The vignettes that include # nolint flags in code chunks have also been updated to only echo the functional code and user-intended comments.

@joshwlambert joshwlambert added the internal Updates that only change internal functions label Nov 20, 2025
@joshwlambert joshwlambert merged commit 3df88e9 into main Nov 20, 2025
11 checks passed
@joshwlambert joshwlambert deleted the nolint-flags branch November 20, 2025 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal Updates that only change internal functions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant