Skip to content

Commit 582fc00

Browse files
committed
Merge pull request #104 from twisted/revert-77-77-special-var-names
Revert "`__version__` is not a violation of the Twisted naming convention.
2 parents baef9ed + f57e000 commit 582fc00

File tree

6 files changed

+22
-20
lines changed

6 files changed

+22
-20
lines changed

twistedchecker/configuration/pylintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ function-rgx=((([a-z])|([a-z]+_[a-z]))[a-zA-Z0-9]+)$|(__[a-z]+__)$|(\_.+)$|(test
6363
# Attribute names should be in mixed case, with the first letter lower case,
6464
# each word separated by having its first letter capitalized just like method names.
6565
# And all private names should begin with an underscore.
66-
attr-rgx=(((([a-z_])|([a-z]+_[a-z])|(__))[a-zA-Z0-9]+|(__))|(([A-Z_][A-Z0-9_]*)))$
66+
attr-rgx=(((([a-z_])|([a-z]+_[a-z]))[a-zA-Z0-9]+)|(([A-Z_][A-Z0-9_]*)))$
6767

6868
# Classes are to be named in mixed case, with the first letter capitalized,
6969
# each word separated by having its first letter capitalized.

twistedchecker/functionaltests/attributename.result

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# enable: C0103
2+
3+
class FooClass:
4+
"""
5+
Attribute names should be in mixed case,
6+
with the first letter lower case,
7+
each word separated by having its first letter capitalized
8+
just like method names.
9+
And all private names should begin with an underscore.
10+
"""
11+
12+
def __init__(self):
13+
"""
14+
A init of this class
15+
"""
16+
self.foo_bar_zar = None
17+
self.FooBarZar = None
18+
self.a = None
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
18:C0103
2+
16:C0103
3+
17:C0103

twistedchecker/functionaltests/attributename.py renamed to twistedchecker/functionaltests/attributename_pass.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,8 @@ def __init__(self):
1313
"""
1414
A init of this class
1515
"""
16-
# Bad names.
17-
self.foo_bar_zar = None
18-
self.FooBarZar = None
19-
self.a = None
20-
self._fooBar_ = None
21-
self._fooBar__ = None
22-
self.__fooBar_ = None
23-
24-
# Good names.
2516
self.fooBarZar = None
2617
self._fooBarZar = None
2718
self.foobar = None
28-
self.__foobar__ = None
29-
self.__fooBar__ = None
30-
self.__dict__ = {}
31-
self.__version__ = {}
3219
# In some cases constants are lazy initialized as instance members.
3320
self.FOOBARZAR = None

twistedchecker/functionaltests/attributename_pass.result

Whitespace-only changes.

0 commit comments

Comments
 (0)