Giter Site home page Giter Site logo

Comments (8)

jayvdb avatar jayvdb commented on May 29, 2024

I like the concept.

from flake8-putty.

jayvdb avatar jayvdb commented on May 29, 2024

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.

The-Compiler avatar The-Compiler commented on May 29, 2024

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.

jayvdb avatar jayvdb commented on May 29, 2024

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.

jayvdb avatar jayvdb commented on May 29, 2024

Strange. I tried it in your repo and it didnt work:
https://travis-ci.org/jayvdb/qutebrowser/jobs/121213530

from flake8-putty.

The-Compiler avatar The-Compiler commented on May 29, 2024

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.

jayvdb avatar jayvdb commented on May 29, 2024

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.

The-Compiler avatar The-Compiler commented on May 29, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.