forked from zuoxingdong/lagom
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.cfg
166 lines (142 loc) · 7.36 KB
/
setup.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# Project configuration parameters.
[flake8]
# Print total number of errors
count = True
# Select some error of code style
# For examples, see https://lintlyci.github.io/Flake8Rules/
select =
# E1: Indentation
E101, # indentation contains mixed spaces and tabs
E111, # indentation is not a multiple of four
E112, # expected an indented block
E113, # unexpected indentation
E114, # indentation is not a multiple of four (comment)
E115, # expected an indented block (comment)
E116, # unexpected indentation (comment)
E121, # Continuation line without enough indentation
E122, # Continuation line without indentation or overdented
E125, # Continuation line with same indent as next logical line
E127, # Continuation line over-indented for visual indent
E128, # Continuation line under-indented for visual indent
E129, # Visually indented line with same indent as next logical line
E131, # Continuation line unaligned for hanging indent
# E2: Whitespace
E201, # Whitespace after '(', e.g. open( 'f')
E202, # Whitespace before ')', e.g. open('f' )
E203, # Whitespace before ':', e.g. open('f') as f :
E211, # Whitespace before '(', e.g. with open ('f')
E221, # Multiple spaces before operator, e.g. a + b
E222, # Multiple spaces after operator, e.g. a + b
E223, # Tab before operator, e.g. if x in [1, 2, 3]
E224, # Tab after operator, e.g. if x in [1, 2, 3]
E225, # Missing whitespace around operator, e.g. if x>5
E227, # Missing whitespace around bitwise or shift operator, e.g. x = 128<<1
E228, # Missing whitespace around modulo operator
E231, # Missing whitespace after ',', ';', or ':', e.g. x = 1,2,3
E241, # Multiple spaces after ',', e.g. x = 1, 2
E242, # Tab after ',', e.g. x = 1, 2, 3
E251, # Unexpected spaces around keyword/parameter equals, e.g. def f(x = 1)
E261, # At least two spaces before inline comment, e.g. x = 5 # only one space comment
E262, # Inline comment should have one space before comment, e.g. x = 5 #no whitespace
E265, # Block comment should have one space before comment, e.g. #no whitespace...
E266, # Too many # before comment, e.g. ## comment, but ok when there's no comment, e.g. #####
E271, # Multiple spaces after keyword, e.g. def f()
E272, # Multiple spaces before keyword
E273, # Tab after keyword
E274, # Tab before keyword
E275, # Missing whitespace after keyword
# E3: Blank line
E301, # Expected 1 blank line, found 0, e.g. between methods
E302, # Expected 2 blank lines, found 0, .e.g. between classes or between import and classes
E303, # Too many blank lines (3)
E304, # Blank lines found after function decorator, e.g. no blank line between @property and method
E305, # Expected 2 blank lines after end of function or class
# E4: Import
E401, # Multiple imports on one line
E402, # Module level import not at top of file. Note that import inside function/class is ok !
# E5: Line length
E502, # The backslash is redundant between brackets, no need for backslash within brackets
# E7: Statement
E701, # Multiple statements on one line (colon)
E702, # Multiple statements on one line (semicolon)
E703, # Statement ends with a semicolon, semicolon is not needed for Python
E704, # Multiple statements on one line (def)
E711, # Comparison to none should be 'if cond is none:'. Do not use `if cond == None`
E712, # Comparison to true should be 'if cond is true:' or 'if cond:' . Do not use `if x == True`
E713, # Test for membership should be 'not in', Do not use `if not x in D`
E714, # Test for object identity should be 'is not'. Do not use `if not x is None`
E721, # Do not compare types, use 'isinstance()'. Do not use `type(a) == A`
E742, # Do not define classes named 'l', 'o', or 'i'
E743, # Do not define functions named 'l', 'o', or 'i'
E999, # Default in flake8, about compiling
# W2: Whitespace warning
W292, # No newline at end of file
# W3: Blank line warning
W391, # One and only one blank line at the end of file
# W6: Deprecation warning
W601, # .has_key() is deprecated, use 'in'
W602, # Deprecated form of raising exception. Use raise ValueError('error')
W603, # '<>' is deprecated, use '!='
W604, # Backticks are deprecated, use 'repr()'
W605, # invalid escape sequence 'x'.
W606, # ‘async’ and ‘await’ are reserved keywords starting with Python 3.7
# Flake8 error code
F402, # Loop variable should not redefine name of imported module
F403, # `from module import *` used; unable to detect undefined names
F405, # Name may be undefined, or defined from star imports
F701, # a break statement outside of a while or for loop
F702, # a continue statement outside of a while or for loop
F811, # Redefinition of unused name from line n, e.g. twice import same module
F812, # List comprehension redefines name from line n, e.g. list comprehension redefines a variable
F821, # undefined name
F822, # undefined name in __all__
F823, # local variable name referenced before assignment
F831, # Duplicate argument name in function definition
F841, # Local variable name is assigned to but never used
F901 # raise NotImplemented should be raise NotImplementedError
# Naming convension
N801, # class names should use CapWords convention
N802, # function name should be lowercase
# Ignore some error of code style
# For examples, see https://lintlyci.github.io/Flake8Rules/
ignore =
# E1: Indentation
E123, # Closing bracket does not match indentation of opening bracket's line
E124, # Closing bracket does not match visual indentation
E126, # Continuation line over-indented for hanging indent
E133, # Closing bracket is missing indentation
# E2: Whitespace
E226, # Missing whitespace around arithmetic operator. Note that we want better convension, e.g. 1 + 2*3
# E5: Line length
E501, # Line too long (79 characters). Note that we want 119 ! Default is too small, bad readability
# E7: Statement
E731, # Do not assign a lambda expression, use a def. Note that it is ok for now.
E741, # Do not use variables named 'l', 'o', or 'i'
# W1: Indentation warning
W191, # Indentation contains tabs
# W2: Whitespace warning
W291, # Trailing whitespace after final character in a line
W293, # Blank line contains whitespace
# W5: Line breaking warning
W503, # line break before binary operator
W504, # line break after binary operator
W505, # doc line too long (82 > 79 characters)
# Flake8 error code
F401, # module imported but unused. Note that we want to allow it in __init__
F404 # Future import(s) name after other statements
# Ignore some files or directories
exclude =
build, # building files
dist, # building files
legacy, # legacy code for backup only
*.pyc,
__pycache__,
.ipynb_checkpoints
# Github convension. Note that default 79 is too small
max-line-length = 120
# print source code in the error
show-source = True
# count number of occurrences of each error
statistics = True
# PyFlakes syntax checking for docstrings
doctests = True