Comments (16)
I published a similar flake8 extension, which is compatible with flake8 3, it's flake8-per-file-ignores.
from flake8-putty.
Hi, @jayvdb do you have any plans to continue working on this?
from flake8-putty.
Great @snoack , I would be happy to accept a README update here linking to your project.
from flake8-putty.
After fixing all the other problems that have emerged since the last build, I assume that this is because pywikibot's tox.ini is installing flake8 v3. Need to test that theory yet.
from flake8-putty.
flake8 documentation about the change: http://flake8.pycqa.org/en/latest/plugin-development/cross-compatibility.html#option-handling-on-flake8-2-and-3
Related fixes in pep8-naming:
PyCQA/pep8-naming@b4c3ebd
PyCQA/pep8-naming@dd623fc
from flake8-putty.
Also, let me point out the log above includes --pre
when calling pip
, so I think your theory is correct.
from flake8-putty.
Yea, the fix for pywikibot was to remove the --pre
, and is merged.
It was easy to bypass the flake8 v3 option handling problem in the opening bug report, but as flake8 v3 is not using pep8 for the StyleGuide, file parsing and other structural classes, getting a hook inside of flake8 will need a lot of work.
However I am still debating in #15 whether this flake8 is needed in a flake8 v3 world.
from flake8-putty.
For now I have updated setup.py in master to indicate it is incompatible with v3.
I'll push this out to pypi as 0.3.3 , along with some other minor fixes, in a few days time, unless v3 comes out of beta sooner.
from flake8-putty.
Apparently 19bc89a is not enough to prevent flake8-putty being used with flake8-v3, as seen at https://phabricator.wikimedia.org/T141257
Possibly caused by older pip/setuptools
(the workaround is to pin flake8<3
in every single project .... huge stupid sigh)
from flake8-putty.
And flake8 v3 is not compatible with Python 2.6
$ git grep OrderedDict
src/flake8/utils.py: parameters = collections.OrderedDict([
src/flake8/utils.py: parameters = collections.OrderedDict([
from flake8-putty.
Would love to see this extension working with flake8 v3, I need it to filter specific "imported but not used" errors (based on the imported module) in my project. I would use v2 but that renders my own custom checker plugin useless.
from flake8-putty.
Hi @omriharel , what is your own custom checker plugin, and why it is useless on v2?
See my response at #15 (comment)
Another critical bug just reported: https://gitlab.com/pycqa/flake8/issues/214
And many more by @asottile about the unusable state of the legacy API, without a replacement API.
flake8-putty fiddles inside the stack frames of flake8 and pycodestyle, so it is not sensible making it work when flake8 v3 internals are very likely to change. But if you really, really need it, I can at least investigate how much of -putty can be achieved without fiddling inside flake8/pycodestyle.
from flake8-putty.
Hi @jayvdb, I think it may be useless on v2 due to my own fault: I wasn't able to understand the plugin documentation very well (and assumed v3 was stable for some reason), so I just delved into its code and tried to figure out how pyflakes and pep8 themselves are plugged into flake8.
My plugin is essentially a collection of checkers added on top of the default plugins (each in their own top level function being registered as a setuptools entry point, similar to the above examples), looking for team and project-specific infractions (and common gotchas) in our medium-sized codebase.
I wasn't able to figure out how to properly make it work with v2, and between this and my particular filtering need, I'd rather just disable the unused import checks until I'm able to use flake8-putty.
This isn't something I really, really need, but would enjoy seeing if and when it becomes possible - thank you for the kind offer, however :)
from flake8-putty.
See #15 (comment)
The v2 compatible version of putty is a hack, fiddling with the stack to bypass some of flake8 in order for this plugin to work. This is reasonable to maintain because v2 is very stable, and it is unlikely that upstream will change its internals, so the hack wont break.
If I provide v3 support using a hack, it is quite likely that it will break, and I am then committed to try and find a solution.
Also, flake8 v3 was a large rewrite which removed the section of code that I was using to get access to flake8 internals, so it will be much harder to reconstruct the hack on flake8 v3, and I'd prefer to not build a hacky version for flake8 v3 anyway.
I hope that flake8 will eventually allow plugins to achieve the same result using a stable API.
from flake8-putty.
Also, fwiw, the other very important flake8 plugin for me is hacking
, and they also are pinned at flake8 v2. So all my projects that use flake8 are also stuck on flake8 v2 until that is resolved.
from flake8-putty.
Cool. There you go: #21
from flake8-putty.
Related Issues (17)
- require code
- line continuation operator HOT 1
- Logical line support
- comments at end of line are not stripped HOT 2
- Ability to change flake8 flags on the fly in source file via inline comments
- flake8 3.0 includes per line noqa HOT 12
- comment in tox dependencies causes packaging.InvalidRequirement HOT 6
- Newbie question on how to actual get putty to be applied HOT 11
- Filename matcher doesn't work? HOT 8
- Predefined ignore patterns HOT 8
- Multiline regex pattern HOT 4
- Selector for python version HOT 2
- Implement recognition of pylint code disabling comments
- Ignore rules in comment at top of module HOT 1
- Microsoft Windows support HOT 3
- Finalise matching algorithm for filenames without a directory separator
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flake8-putty.