Skip to content

Turn off line length linter within string literals (optionally?) #856

Open
@MichaelChirico

Description

@MichaelChirico

We've got a very common scenario where string literals are used to contain big SQL queries.

Crucially, the style guide for SQL & R differ in that the former's max line width is 100, the latter 80.

Moreover, to skip only one such line we've got to somewhat awkwardly inject the nolint tag inside the SQL:

query <- "
  SELECT SUM(CASE WHEN some_column > 5 THEN 5 ELSE some_column END) AS output_column -- # nolint
"

It seems to me the best solution here is to simply ignore string literal "bodies", perhaps with an option.

Happy to implement this if others agree.

Metadata

Metadata

Assignees

No one assigned

    Labels

    false-positivecode that shouldn't lint, but does

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions