[code-quality] Flake8 "globals"

Chris Norman chris.norman2 at googlemail.com
Sun Feb 11 16:19:11 EST 2018


Hi everyone,

I've been using pyflakes and now flake8 for a while and honestly it's 
probably the second-most used program on my computer, second only to 
Python. I am a very happy customer and want to extend my warmest 
gratitude to the creators and maintainers!


I have a suggestion which I suspect is already implemented I just don't 
know how to find the option:

Using Flake8, I want to be able to set up globals like you can with 
eslint. This should allow me to say that there are globals present in 
the file which aren't currently there.

I get that the use case is kind of non standard: I am evaling code found 
in an arbitrary, and of coruse that code is inheriting the globals and 
locals from the main script. To this end, I want to be able to do more 
than just put # noqa: F821 at the end of each line that contains one of 
the locals.. that is very inconvenient and runs the high risk of 
suppressing a real live issue.


Is this already done? If not should I open an issue on Gitlab?

I'd be more than happy to dig in and try make a fix for this myself but 
I have no idea how flake8 works ETC, so if I could be given some 
pointers on where to start that would be awesome, even if those pointers 
are simply RTFM! :)


Thank you all so much, and I hope everyone is having a wonderful day.




More information about the code-quality mailing list