SublimeLinter / SublimeLinter-flake8

SublimeLinter plugin for python, using flake8.
MIT License
184 stars 28 forks source link

Filter WS errors Sublime can auto-fix #93

Closed kaste closed 6 years ago

kaste commented 6 years ago

Add filter-codes setting for post-processing the returned errors. By default, filter some whitespace codes which Sublime will auto-fix on save.

Fixes #65

kaste commented 6 years ago

Added E999 fix

braver commented 6 years ago

IIRC (been a while since I tried) you can already make these codes invisible via styles. Perhaps that already covers the use case and we can add some docs on how to do it?

kaste commented 6 years ago

The main ux problem is that the panel opens after save, then sublime applies the fixes, the linter runs again, and the panel disappears again.

That being said, hiding highlights is not a really good feature imo. Bc they still show up in the panel and status bar. I can also of course jump to them. On the other side hiding gutter icons is totally :+1:. Also of course styling the highlights per code or per linter. Dynamically hiding the highlights either while busy or per toggle is also :+1:. It's just that permanently hiding them doesn't work really well.

braver commented 6 years ago

Jep, makes a lot of sense and agreed then. This is exactly where it's ok for the linter configuration in your editor to deviate from the one on disk.

Another question then.

Can't you do this via args already? flake8 takes a --ignore=errors arg. As I've outlined before, I don't like introducing settings that mirror args.

kaste commented 6 years ago

--ignore overwrites all configuration, so basically you would have to read the flake8.ini file and then append the codes. Virtually impossible bc the config file can have three or four different names, and can be placed like everywhere.

I also considered a PR against flake8 itself but the source code of flake8 was not really prepared for that. So a PR would either get long or hairy.

braver commented 6 years ago

--ignore overwrites all configuration

Oh, I didn't realise that. Good then.