Comments (8)
I like the concept.
from flake8-putty.
So I guess this was primarily raised about per line ignore rules. My only problem with this is that this lends itself to lines ending with
# flake8: disable=F841 pylint: disable=unused-variable
or the less readable
# flake8: disable=F841 pylint: disable=W0612
To avoid this, I think we need putty to detect pylint's error names like unused-variable
(and maybe codes like W0612
), and map them to flake8 codes, so that # pylint: disable=unused-variable
is respected by flake8.
Probably more useful is to support pylint's ignore rules that occur at the top of the file.
If pylint syntax was supported as above, would you still want support for # flake8: disable=F841
?
from flake8-putty.
I currently have a mixture of both in my config:
putty-ignore =
/# pylint: disable=invalid-name/ : +N801,N806
/# pylint: disable=wildcard-import/ : +F403
/# pragma: no mccabe/ : +C901
/# flake8: disable=E131/ : +E131
/# flake8: disable=N803/ : +N803
/# flake8: disable=T002/ : +T002
/# flake8: disable=F841/ : +F841
/# flake8: disable=S001/ : +S001
tests/*/*/test_*.py : +D100,D101,D401
tests/*/test_*.py : +D100,D101,D401
tests/unit/browser/http/test_content_disposition.py : +D400
scripts/dev/ci/install.py : +C901
for the ones where I use # flake8: disable=...
, I only have that:
$ ack 'flake8: disable' qutebrowser
qutebrowser/utils/log.py
278: 'been edited', # flake8: disable=E131
318: 'with: -9805', # flake8: disable=E131
qutebrowser/browser/network/networkreply.py
33: def __init__(self, request, fileData, mimeType, # flake8: disable=N803
qutebrowser/browser/rfc6266.py
52:token_chars = attr_chars + "*'%" # flake8: disable=S001
qutebrowser/misc/crashsignal.py
25:import pdb # flake8: disable=T002
So I think both would make sense. I'm not sure it's surprising if flake8/flake8-putty interprets pylint: ...
comments by default though.
from flake8-putty.
Ok, basic line based handling of # flake8: disable=
done in 738b26e introducing new config variable putty_auto_ignore=True
, which should solve your initial request.
per file header and pylint support can be a separate issue.
from flake8-putty.
Strange. I tried it in your repo and it didnt work:
https://travis-ci.org/jayvdb/qutebrowser/jobs/121213530
from flake8-putty.
Hmm, that's weird. I had a quick look at your commit but I don't see anything obvious being wrong...
Just a small request: Can you please remove the notifications
block from .travis.yml
when you want to try out more stuff? Otherwise, the Travis CI bot will send a notification to the IRC channel every time 😉
from flake8-putty.
Sorry I wasnt intended to use your project for testing; I was intending to submit a PR with this feature implemented.
I found and fixed two bugs, so this now works in v0.3.2. I ran another test (causing another IRC notification probably), and indeed v0.3.2 does fix the problem for your repo.
But I see that it appears you are using a tool to update dependencies in tox , so I wont submit PR.
Raised #6 and #7 to track other features discussed here.
from flake8-putty.
Thanks a lot for your work on this! I can confirm it works fine now 🎉
But I see that it appears you are using a tool to update dependencies in tox , so I wont submit PR.
Damn, I guess I failed the turing test 😆
I actually do those by hand, I just made it a habit to paste the changelog in the commit as I read it anyways.
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
- putty is not flake8 v3 compatible HOT 16
- 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
- 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.