flake8-putty icon indicating copy to clipboard operation
flake8-putty copied to clipboard

flake8 3.0 includes per line noqa

Open jayvdb opened this issue 9 years ago • 12 comments
trafficstars

This will at least make some parts of flake8-putty unnecessary, similar to https://github.com/spookylukey/flake8-respect-noqa/issues/3

Should this plugin only support flake8 2.x and recommend that requests for similar functionality in flake8 3.x be requested as features for the main utility, at least until there is push back from the maintainers like there was in flake8 2.x.

jayvdb avatar Jun 26 '16 03:06 jayvdb

The main features which would need re-implementing are line regex , and environment markers. I think it is worth trying to implement them properly inside flake8 v3, or as an extension using a proper v3 style approach.

jayvdb avatar Jun 26 '16 18:06 jayvdb

What about per-file/directory ignores, is this something flake8 3.0 can already handle?

For example, I do this:

putty-ignore =
    tests/*/test_*.py : +D100,D101,D401    # (mostly some pytest magic flake8 doesn't understand)
    tests/unit/browser/webkit/http/test_content_disposition.py : +D400   # (docstrings from external source I don't want to deviate from)
    scripts/dev/ci/appveyor_install.py : +FI53  # (needs future import as it needs to be python 2 compatible)

The-Compiler avatar Jun 30 '16 09:06 The-Compiler

@sigmavirus24, are there any features mentioned above that you would object to being in flake8 v3?

jayvdb avatar Jun 30 '16 10:06 jayvdb

per-file/directory ignores are things I do not want in Flake8 3.0. putty would be a good place to keep them.

sigmavirus24 avatar Jun 30 '16 11:06 sigmavirus24

Ok. Does the flake8 v3 api allow for customisations like that?

jayvdb avatar Jun 30 '16 13:06 jayvdb

We don't allow you to replace the StyleGuide. You can register your own formatter to do that kind of thing though. This is all documented on flake8.pycqa.org. If the docs need to be improved, please let me know. I'm trying to drastically improve them given how awful 2.x's docs were.

sigmavirus24 avatar Jun 30 '16 14:06 sigmavirus24

Thanks. Good to know it is going to be easier in v3.

jayvdb avatar Jun 30 '16 14:06 jayvdb

Eh, I'm starting to soften on this idea. We could target it for a Flake8 3.x release. I have an idea of how we might implement it too.

sigmavirus24 avatar Jul 08 '16 00:07 sigmavirus24

Any work on this? I would like love to use the new flake8 for my project, but this is keeping me.

JelteF avatar Aug 16 '16 18:08 JelteF

I am waiting for flake8 v3 to stablise, before using it in my own projects, and thus before I commit time to trying to make -putty work with v3, and definitely before I release a version that allows -putty to support v3.

Last time I tried it, it failed very badly: https://gitlab.com/pycqa/flake8/issues/205 I see another similarly fundamental problem has been raised: https://gitlab.com/pycqa/flake8/issues/209

If someone wants to do the leg work before me, I am ok with releasing a pre-release of -putty.

jayvdb avatar Aug 17 '16 14:08 jayvdb

Fair enough.Thanks for the useful plugin.

JelteF avatar Aug 17 '16 14:08 JelteF

@sigmavirus24

We don't allow you to replace the StyleGuide. You can register your own formatter to do that kind of thing though. This is all documented on flake8.pycqa.org. If the docs need to be improved, please let me know. I'm trying to drastically improve them given how awful 2.x's docs were.

I looked through the docs and the code, and it's clear how to use a formatter to keep errors from being outputted. However, there doesn't seem to be a way to have a formatter not count the error count recorded by the style guide. This means that even if you used putty to ignore errors , the exit status would still be nonzero. CI systems and git hooks depend on the exit status being correct, so I think it's still not possible to update update flake8-putty to be compatible with flake8 3+.

lucaswiman avatar Jun 24 '17 00:06 lucaswiman