flake8 plugin to prevent from global variables using.
pip install flake8-global-variables
Things checked with this plugin:
# Global variable declaration
global_hello = 'Hello'
def fun_a():
return 2
def fun_b(var=5):
result = fun_a() + var
return result
# And here global variable again
global_var = 3
fun_b(global_var)
Error code | Description |
---|---|
GV400 | Found global variable |
MIT.