Skip to content

Skip lines with #noqa comment#81

Open
mnojek wants to merge 5 commits intoboakley:masterfrom
mnojek:feature/skip-linter-for-tagged-lines
Open

Skip lines with #noqa comment#81
mnojek wants to merge 5 commits intoboakley:masterfrom
mnojek:feature/skip-linter-for-tagged-lines

Conversation

@mnojek
Copy link

@mnojek mnojek commented Jul 1, 2020

I find it very useful to have a feature to omit by linter the lines containing specific comment just like it works in pylama. The regex pattern is taken from pylama project — it's simple and works properly.

By putting a comment starting with noqa it is possible now to ignore these lines by linter. The problem is that some rules that report the issues on the first line of the element (keyword's name or test case's title) will not be displayed. Because of that I fixed TagWithSpaces rule to report the issue on the line where the tag appears and not on the line of the test case title. There may be some other rules that report wrong line number but it's the problem of the rule itself, not the feature.

I tried to implement the same feature here. Added also some test cases that verifies that it works well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants