Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Allow reserverd __XXX__ variable names #105

Merged
merged 2 commits into from
Oct 20, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion twistedchecker/configuration/pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function-rgx=((([a-z])|([a-z]+_[a-z]))[a-zA-Z0-9]+)$|(__[a-z]+__)$|(\_.+)$|(test
# Attribute names should be in mixed case, with the first letter lower case,
# each word separated by having its first letter capitalized just like method names.
# And all private names should begin with an underscore.
attr-rgx=(((([a-z_])|([a-z]+_[a-z]))[a-zA-Z0-9]+)|(([A-Z_][A-Z0-9_]*)))$
attr-rgx=(((([a-z_])|([a-z]+_[a-z]))[a-zA-Z0-9]+)|(([A-Z_][A-Z0-9_]*))|(__[a-zA-Z0-9][a-zA-Z0-9_]*[a-zA-Z0-9]+__)|(__[a-zA-Z0-9]__))$

# Classes are to be named in mixed case, with the first letter capitalized,
# each word separated by having its first letter capitalized.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,26 @@ def __init__(self):
"""
A init of this class
"""
# Bad names.
self.foo_bar_zar = None
self.FooBarZar = None
self.a = None
self._fooBar_ = None
self._fooBar__ = None
self.__fooBar_ = None
self.___longStart__ = None
self.__longEnd___ = None

# Good names.
self.fooBarZar = None
self._fooBarZar = None
self.foobar = None
# Any __*__ name is accepted.
self.__foobar__ = None
self.__fooBar__ = None
self.__foo_bar__ = None
self.__dict__ = {}
self.__version__ = {}
self.__a__ = {}
# In some cases constants are lazy initialized as instance members.
self.FOOBARZAR = None
8 changes: 8 additions & 0 deletions twistedchecker/functionaltests/attributename.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
19:C0103
24:C0103
20:C0103
22:C0103
23:C0103
17:C0103
18:C0103
21:C0103
18 changes: 0 additions & 18 deletions twistedchecker/functionaltests/attributename_fail.py

This file was deleted.

3 changes: 0 additions & 3 deletions twistedchecker/functionaltests/attributename_fail.result

This file was deleted.

Empty file.