prospector icon indicating copy to clipboard operation
prospector copied to clipboard

Possible to support path/pattern-specific ignores?

Open Deimos opened this issue 7 years ago • 3 comments

I'm looking at switching to Prospector from Pylama, and one of the capabilities of Pylama that I really liked was the ability to disable specific errors for particular paths/patterns: https://pylama.readthedocs.io/en/latest/#set-options-for-file-group-of-files

As a specific use case, my application uses Marshmallow schemas, which often trigger pylint's no-self-use check because of how certain capabilities are implemented. I'd like to keep this check enabled for the application as a whole though, and Pylama allowed me to just disable it for the entire schemas/ directory.

Another useful case was ignoring pyflakes's "imported but unused" check in all __init__.py files.

Is there any way to duplicate that in Prospector, or would it be feasible to implement?

Deimos avatar Aug 29 '18 21:08 Deimos

I'm having the same situation but for tests: I'm writing a library and while I want documentation warning on the library, I don't want them on the tests.

It's easier to solve that @Deimos problem since I can just run prospector twice: once for my library package and once for my test, with different options, but it's not nice and does not integrate well with IDE such as vscode

victornoel avatar Sep 21 '18 11:09 victornoel

the idea with 'profiles' was originally to have project-specific configuration that could be shared, so in a way a profile per-subfolder would sort of do this but you'd have to have one 'root' profile then one profile in tests and one in main code that inherit from it and then run prospector twice.

That's just due to how inheritance works right now, it's completely top down. It might be worth trying to do bottom up instead but it depends. I will think a bit but any good ideas are welcome :-)

carlio avatar Oct 07 '18 20:10 carlio

@carlio is the scenario you just described currently doable?

The problem with profiles right now is that I tried running prospector on say, my tests folder, but then pylint or mypy can't find the main modules then and complain about it…

victornoel avatar Oct 08 '18 07:10 victornoel