We currently support python 2.6, 2.7, 3.3, 3.4, 3.5, and pypy's latestĥ.x branch for Python environments. We should also have money enough to add more build Things like Jenkins! This allows us to run ci.įlake8 has been using this for continuous integration with GitLab forĪ while now, but we've recently moved the public address fromĬi. (my temporary domain) to ci. and added moreīuild capacity. So, Rackspace has provided us with some sponsorship so we can run Is this a bug in flake8/pyflakes or just my understanding of how _version_ and _author_ are exempt from F401 errors normally. I could also add _version_ and _author_ to _all_ in init.py, but then they would be imported if anyone used "from my_module import *", which is definitely not what I want. Is there anything I can do about this? I know I could add "# noqa: F401" to the end of the import, but it just feels like a bit of a "hack" to me. _init_.py:1:1: F401 '_version._version_' imported but unused _init_.py:1:1: F401 '_version._author_' imported but unused I'm looking for a way to import _version_ / _author_ into my _init_.py without causing an F401 error.ĭefining _version_ normally works fine:īut if I define them in an external file and import them, I get an F401 error:įrom _version_ import _version_, _author_ # I get an F What am I doing wrong? Or can I not do what I think I want to do? ) Plugin always runs and that they have to suppress the U4 errors if they don't I don't want to have to tell users that the Off_by_default=True class attribute, but as soon as I add that, there doesn't I know that the extension runs just fine if I don't include the What I'd like to be able to do is to tell users to add this to say theirĪnd that would enable my extension. 'flake8.extensions': ,Īll of the plugin's errors are U40X and U41X codes. I have a checker plugin that starts out like:Īnd it registers itself via an entry point like so: It's possible that I'm misunderstanding how it's supposed to I'm having trouble getting flake8 v3's -enable-extensions feature to work the Submit a PR or whatever the gitlab equivalent is.) Layering order would be prepend, local files, append, user. Is there another way to go about this that I haven't considered? Would itīe reasonable to add a "-prepend-config" argument? In which case the Specifying all known project file names.). Surprising results if a dev put settings in say "setup.cfg" and the wrapperĪlways tried ".flake8" (though we could minimize such surprises by Global + local could work but local settings would have to be in a fixedįile. A wrapper that runs flake8 with -append-config to layer first Useful as that forces a single configuration file. The closest thing is the user configuration, but that is layered on top of The question is more about how to specify the global configįlake8's doesn't seem to have the notion of a global base configuration Pretty sure that we'd need a wrapper script to handle the globalĬonfiguration. In this way, projectsĬould simply add, say, -flake8 to their requirements.txt file. It would also bring in the global configuration file. I was thinking was that we'd have a private python package that brings inįlake8 plus any plugin packages and custom extensions (similar to hacking) I'm looking for guidance about how to go about doing this with flake8. Ideally, a developer should be able to run a single command to do style to gradually transition a project to our style rule by rule). Individual project could have a configuration that contained line length, any explicit select/ignore settings, etc.). We have multiple python projects over multiple (private) repos in githubĪnd I would like all of them to share a standard, organization-wide style Is there a way to get pylint to play nice with compatibility code? Can I refactor my code to play nicer with pylint? Since it is a severe error requiring action under most circumstances, I don't want a mental "just ignore syntax-error" to be a required for reading reports. I don't want to ignore compatibility code per se, as it tends to collect quite a lot of code smell. It is not possible to disable this error with either `# pylint: skip-file` or `# pylint: disable=syntax-error` at the start of the file. When I run the check with python3, all python2-only code produces syntax-error. Pylint is having a hard time with this approach. I have found a bug report on a similar issue but it was closed. There are other projects where I do the same. I am having problems disabling the pylint `syntax-error` for compatibility code.īasically, I have a compatibility sub-package that tries importing different variants of code until it does not hit Synta圎rror.
0 Comments
Leave a Reply. |