Skip to content

commas_linter does not recognize lints when preceded by a blank line #111

Closed
@emallickhossain

Description

@emallickhossain

I've found that the commas_linter does not recognize lints when the line to be linted is preceded by a blank line or a commented line. Below is a minimal working example:

file: Test.r

#random comment

a <- c(4,5)
b = 7

Then, I run the following:

lintr::lint("./Test.r", linters = list(spacesAfterCommas = commas_linter, 
                                       useArrowForAssignments = assignment_linter))

The only error I get is the following:

./Test.r:4:3: style: Use <-, not =, for assignment.
b = 7
  ^

Why is the commas_linter not catching my error? If I remove the blank line, commas_linter catches the lint.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions