IssueRaiser

Provide an `exclude` option for linters in .analysis_options

It would be nice to be able to turn off linters, but keep the analyzer itself running on a specific directory within a project. The immediate use case I have in mind is the `test/` directory. We try to use strong mode consistently, and would prefer to enable most of the linters. However, a lot of test code ends up failing on one linter or another. Sometimes this is due to issues that could be resolved with a few extra lines of code (we don't always cancel stream subscriptions in tests, for instance), but often there are very good reasons for the failures. For example, `expectAsync` often requires a type cast (`as`) when strong mode is on. Would it be possible to support something like below? ``` yaml analyzer: strong-mode: true exclude: - do/not/analyze/this/** linter: rules: - so - many - linters exclude: - test/** ``` This would essentially say to allow the analyzer, but not the linters, to run on `test/`. I think that anything excluded in the `analyzer` section should also be excluded from linting, so `do/not/analyze/this/**` would be implicitly included in the second `exclude` block.

Posted by georgelesica-wf on Oct 24, 2016, 8:40 PM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.4,500 issues0 comments

support (Other)

Provide an `exclude` option for linters in .analysis_options

georgelesica-wfOct 24, 2016, 8:40 PM

It would be nice to be able to turn off linters, but keep the analyzer itself running on a specific directory within a project. The immediate use case I have in mind is the `test/` directory. We try to use strong mode consistently, and would prefer to enable most of the linters. However, a lot of test code ends up failing on one linter or another. Sometimes this is due to issues that could be resolved with a few extra lines of code (we don't always cancel stream subscriptions in tests, for instance), but often there are very good reasons for the failures. For example, `expectAsync` often requires a type cast (`as`) when strong mode is on. Would it be possible to support something like below? ``` yaml analyzer: strong-mode: true exclude: - do/not/analyze/this/** linter: rules: - so - many - linters exclude: - test/** ``` This would essentially say to allow the analyzer, but not the linters, to run on `test/`. I think that anything excluded in the `analyzer` section should also be excluded from linting, so `do/not/analyze/this/**` would be implicitly included in the second `exclude` block.

Comments (0)

No comments yet. Start the discussion.

Comment on this issue