forked from PyCQA/pycodestyle
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add checker for local variables inside functions
Do not signal globals as local variables
- Loading branch information
1 parent
14add34
commit 31a9435
Showing
2 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#: Okay | ||
def test(): | ||
good = 1 | ||
#: Okay | ||
def test(): | ||
def test2(): | ||
good = 1 | ||
#: Okay | ||
GOOD = 1 | ||
#: Okay | ||
class Test(object): | ||
GOOD = 1 | ||
#: E805 | ||
def test(): | ||
Bad = 1 | ||
#: E805 | ||
def test(): | ||
VERY = 2 | ||
#: E805 | ||
def test(): | ||
def test2(): | ||
class Foo(object): | ||
def test3(self): | ||
Bad = 3 | ||
#: Okay | ||
def good(): | ||
global Bad | ||
Bad = 1 | ||
#: E805 | ||
def bad(): | ||
global Bad | ||
|
||
def foo(): | ||
Bad = 1 |