Skip to content

Commit 40aa9c7

Browse files
committed
Code cleanup and allowing for creator functions instead of DB-API modules (suggested by Ezio Vernacotola).
1 parent 131adf5 commit 40aa9c7

20 files changed

Lines changed: 762 additions & 290 deletions

.pylintrc

Lines changed: 318 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,318 @@
1+
# lint Python modules using external checkers.
2+
#
3+
# This is the main checker controling the other ones and the reports
4+
# generation. It is itself both a raw checker and an astng checker in order
5+
# to:
6+
# * handle message activation / deactivation at the module level
7+
# * handle some basic but necessary stats'data (number of classes, methods...)
8+
9+
#
10+
[MASTER]
11+
12+
# Specify a configuration file.
13+
#rcfile=
14+
15+
# Python code to execute, usually for sys.path manipulation such as
16+
# pygtk.require().
17+
#init-hook=
18+
19+
# Profiled execution.
20+
profile=no
21+
22+
# Add <file or directory> to the black list. It should be a base name, not a
23+
# path. You may set this option multiple times.
24+
ignore=CVS
25+
26+
# Pickle collected data for later comparisons.
27+
persistent=yes
28+
29+
# Set the cache size for astng objects.
30+
cache-size=500
31+
32+
# List of plugins (as comma separated values of python modules names) to load,
33+
34+
# usually to register additional checkers.
35+
load-plugins=
36+
37+
38+
[MESSAGES CONTROL]
39+
40+
# Enable only checker(s) with the given id(s). This option conflict with the
41+
# disable-checker option
42+
#enable-checker=
43+
44+
# Enable all checker(s) except those with the given id(s). This option conflict
45+
# with the disable-checker option
46+
#disable-checker=
47+
48+
# Enable all messages in the listed categories.
49+
#enable-msg-cat=
50+
51+
# Disable all messages in the listed categories.
52+
#disable-msg-cat=
53+
54+
# Enable the message(s) with the given id(s).
55+
#enable-msg=
56+
57+
# Disable the message(s) with the given id(s).
58+
#disable-msg=
59+
60+
61+
[REPORTS]
62+
63+
# set the output format. Available formats are text, parseable, colorized, msvs
64+
# (visual studio) and html
65+
output-format=text
66+
67+
# Include message's id in output
68+
include-ids=no
69+
70+
# Put messages in a separate file for each module / package specified on the
71+
# command line instead of printing them on stdout. Reports (if any) will be
72+
# written in a file name "pylint_global.[txt|html]".
73+
files-output=no
74+
75+
# Tells wether to display a full report or only the messages
76+
reports=yes
77+
78+
# Python expression which should return a note less than 10 (10 is the highest
79+
# note).You have access to the variables errors warning, statement which
80+
# respectivly contain the number of errors / warnings messages and the total
81+
# number of statements analyzed. This is used by the global evaluation report
82+
# (R0004).
83+
evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
84+
85+
# Add a comment according to your evaluation note. This is used by the global
86+
# evaluation report (R0004).
87+
comment=no
88+
89+
# Enable the report(s) with the given id(s).
90+
#enable-report=
91+
92+
# Disable the report(s) with the given id(s).
93+
#disable-report=
94+
95+
96+
# checks for :
97+
98+
# * doc strings
99+
# * modules / classes / functions / methods / arguments / variables name
100+
# * number of arguments, local variables, branchs, returns and statements in
101+
# functions, methods
102+
# * required module attributes
103+
# * dangerous default values as arguments
104+
# * redefinition of function / method / class
105+
# * uses of the global statement
106+
#
107+
[BASIC]
108+
109+
# Required attributes for module, separated by a comma
110+
required-attributes=
111+
112+
# Regular expression which should only match functions or classes name which do
113+
114+
# not require a docstring
115+
no-docstring-rgx=__.*__
116+
117+
# Regular expression which should only match correct module names
118+
module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
119+
120+
# Regular expression which should only match correct module level names
121+
const-rgx=(([A-Z_][A-Z1-9_]*)|(__.*__))$
122+
123+
# Regular expression which should only match correct class names
124+
class-rgx=[A-Z_][a-zA-Z0-9]+$
125+
126+
# Regular expression which should only match correct function names
127+
function-rgx=[a-z_][a-z0-9_]{2,30}$
128+
129+
# Regular expression which should only match correct method names
130+
method-rgx=[a-z_][a-z0-9_]{2,30}$
131+
132+
# Regular expression which should only match correct instance attribute names
133+
attr-rgx=[a-z_][a-z0-9_]{2,30}$
134+
135+
# Regular expression which should only match correct argument names
136+
argument-rgx=[a-z_][a-z0-9_]{2,30}$
137+
138+
# Regular expression which should only match correct variable names
139+
variable-rgx=[a-z_][a-z0-9_]{2,30}$
140+
141+
# Regular expression which should only match correct list comprehension /
142+
143+
# generator expression variable names
144+
inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
145+
146+
# Good variable names which should always be accepted, separated by a comma
147+
good-names=i,j,k,ex,Run,_
148+
149+
# Bad variable names which should always be refused, separated by a comma
150+
bad-names=foo,bar,baz,toto,tutu,tata
151+
152+
# List of builtins function names that should not be used, separated by a comma
153+
bad-functions=map,filter,apply,input
154+
155+
156+
# try to find bugs in the code using type inference
157+
#
158+
[TYPECHECK]
159+
160+
# Tells wether missing members accessed in mixin class should be ignored. A
161+
# mixin class is detected if its name ends with "mixin" (case insensitive).
162+
ignore-mixin-members=yes
163+
164+
# When zope mode is activated, consider the acquired-members option to ignore
165+
# access to some undefined attributes.
166+
zope=no
167+
168+
# List of members which are usually get through zope's acquisition mecanism and
169+
# so shouldn't trigger E0201 when accessed (need zope=yes to be considered).
170+
acquired-members=REQUEST,acl_users,aq_parent
171+
172+
173+
# checks for
174+
# * unused variables / imports
175+
# * undefined variables
176+
# * redefinition of variable from builtins or from an outer scope
177+
# * use of variable before assigment
178+
#
179+
[VARIABLES]
180+
181+
# Tells wether we should check for unused import in __init__ files.
182+
init-import=no
183+
184+
# A regular expression matching names used for dummy variables (i.e. not used).
185+
dummy-variables-rgx=_|dummy
186+
187+
# List of additional names supposed to be defined in builtins. Remember that
188+
189+
# you should avoid to define new builtins when possible.
190+
additional-builtins=
191+
192+
193+
# checks for :
194+
# * methods without self as first argument
195+
# * overridden methods signature
196+
# * access only to existant members via self
197+
# * attributes not defined in the __init__ method
198+
# * supported interfaces implementation
199+
# * unreachable code
200+
#
201+
[CLASSES]
202+
203+
# List of interface methods to ignore, separated by a comma. This is used for
204+
# instance to not check methods defines in Zope's Interface base class.
205+
ignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by
206+
207+
# List of method names used to declare (i.e. assign) instance attributes.
208+
defining-attr-methods=__init__,__new__,setUp
209+
210+
211+
# checks for sign of poor/misdesign:
212+
# * number of methods, attributes, local variables...
213+
# * size, complexity of functions, methods
214+
#
215+
[DESIGN]
216+
217+
# Maximum number of arguments for function / method
218+
#max-args=5
219+
max-args=15
220+
221+
# Maximum number of locals for function / method body
222+
max-locals=15
223+
224+
# Maximum number of return / yield for function / method body
225+
max-returns=6
226+
227+
# Maximum number of branch for function / method body
228+
#max-branchs=12
229+
max-branchs=25
230+
231+
# Maximum number of statements in function / method body
232+
#max-statements=50
233+
max-statements=75
234+
235+
# Maximum number of parents for a class (see R0901).
236+
max-parents=7
237+
238+
# Maximum number of attributes for a class (see R0902).
239+
#max-attributes=7
240+
max-attributes=20
241+
242+
# Minimum number of public methods for a class (see R0903).
243+
#min-public-methods=2
244+
min-public-methods=1
245+
246+
# Maximum number of public methods for a class (see R0904).
247+
max-public-methods=20
248+
249+
250+
# checks for
251+
# * external modules dependencies
252+
# * relative / wildcard imports
253+
# * cyclic imports
254+
# * uses of deprecated modules
255+
#
256+
[IMPORTS]
257+
258+
# Deprecated modules which should not be used, separated by a comma
259+
deprecated-modules=regsub,string,TERMIOS,Bastion,rexec
260+
261+
# Create a graph of every (i.e. internal and external) dependencies in the
262+
# given file (report R0402 must not be disabled)
263+
import-graph=
264+
265+
# Create a graph of external dependencies in the given file (report R0402 must
266+
# not be disabled)
267+
ext-import-graph=
268+
269+
# Create a graph of internal dependencies in the given file (report R0402 must
270+
# not be disabled)
271+
int-import-graph=
272+
273+
274+
# checks for :
275+
# * unauthorized constructions
276+
# * strict indentation
277+
# * line length
278+
# * use of <> instead of !=
279+
#
280+
[FORMAT]
281+
282+
# Maximum number of characters on a single line.
283+
max-line-length=80
284+
285+
# Maximum number of lines in a module
286+
max-module-lines=1000
287+
288+
# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
289+
# tab).
290+
#indent-string=' '
291+
indent-string='\t'
292+
293+
294+
# checks for:
295+
# * warning notes in the code like FIXME, XXX
296+
# * PEP 263: source code with non ascii character but no encoding declaration
297+
#
298+
[MISCELLANEOUS]
299+
300+
# List of note tags to take in consideration, separated by a comma.
301+
notes=FIXME,XXX,TODO
302+
303+
304+
# checks for similarities and duplicated code. This computation may be
305+
# memory / CPU intensive, so you should disable it if you experiments some
306+
# problems.
307+
308+
#
309+
[SIMILARITIES]
310+
311+
# Minimum lines number of a similarity.
312+
min-similarity-lines=4
313+
314+
# Ignore comments when computing similarities.
315+
ignore-comments=yes
316+
317+
# Ignore docstrings when computing similarities.
318+
ignore-docstrings=yes

0 commit comments

Comments
 (0)