FreeCAD
/
.pylintrc
614 строк · 19.8 Кб
1[MAIN]
2
3# Analyse import fallback blocks. This can be used to support both Python 2 and
4# 3 compatible code, which means that the block might have code that exists
5# only in one or another interpreter, leading to false positives when analysed.
6analyse-fallback-blocks=yes
7
8# Load and enable all available extensions. Use --list-extensions to see a list
9# all available extensions.
10#enable-all-extensions=
11
12# In error mode, messages with a category besides ERROR or FATAL are
13# suppressed, and no reports are done by default. Error mode is compatible with
14# disabling specific errors.
15#errors-only=
16
17# Always return a 0 (non-error) status code, even if lint errors are found.
18# This is primarily useful in continuous integration scripts.
19#exit-zero=
20
21# A comma-separated list of package or module names from where C extensions may
22# be loaded. Extensions are loading into the active Python interpreter and may
23# run arbitrary code.
24extension-pkg-allow-list=
25
26# A comma-separated list of package or module names from where C extensions may
27# be loaded. Extensions are loading into the active Python interpreter and may
28# run arbitrary code. (This is an alternative name to extension-pkg-allow-list
29# for backward compatibility.)
30extension-pkg-whitelist=
31
32# Return non-zero exit code if any of these messages/categories are detected,
33# even if score is above --fail-under value. Syntax same as enable. Messages
34# specified are enabled, while categories only check already-enabled messages.
35fail-on=
36
37# Specify a score threshold to be exceeded before program exits with error.
38fail-under=10
39
40# Interpret the stdin as a python script, whose filename needs to be passed as
41# the module_or_package argument.
42#from-stdin=
43
44# Files or directories to be skipped. They should be base names, not paths.
45ignore=CVS
46
47# Add files or directories matching the regex patterns to the ignore-list. The
48# regex matches against paths and can be in Posix or Windows format.
49ignore-paths=
50
51# Files or directories matching the regex patterns are skipped. The regex
52# matches against base names, not paths. The default value ignores Emacs file
53# locks
54ignore-patterns=^\.#
55
56# List of module names for which member attributes should not be checked
57# (useful for modules/projects where namespaces are manipulated during runtime
58# and thus existing member attributes cannot be deduced by static analysis). It
59# supports qualified module names, as well as Unix pattern matching.
60ignored-modules=FreeCAD,FreeCADGui
61
62# Python code to execute, usually for sys.path manipulation such as
63# pygtk.require().
64#init-hook=
65
66# Use multiple processes to speed up Pylint. Specifying 0 will auto-detect the
67# number of processors available to use, and will cap the count on Windows to
68# avoid hangs.
69jobs=1
70
71# Control the amount of potential inferred values when inferring a single
72# object. This can help the performance when dealing with large functions or
73# complex, nested conditions.
74limit-inference-results=100
75
76# List of plugins (as comma separated values of python module names) to load,
77# usually to register additional checkers.
78load-plugins=
79
80# Pickle collected data for later comparisons.
81persistent=yes
82
83# Minimum Python version to use for version dependent checks. Will default to
84# the version used to run pylint.
85py-version=3.8
86
87# Discover python modules and packages in the file system subtree.
88recursive=no
89
90# When enabled, pylint would attempt to guess common misconfiguration and emit
91# user-friendly hints instead of false-positive error messages.
92suggestion-mode=yes
93
94# Allow loading of arbitrary C extensions. Extensions are imported into the
95# active Python interpreter and may run arbitrary code.
96unsafe-load-any-extension=no
97
98# In verbose mode, extra non-checker-related info will be displayed.
99#verbose=
100
101
102[REPORTS]
103
104# Python expression which should return a score less than or equal to 10. You
105# have access to the variables 'fatal', 'error', 'warning', 'refactor',
106# 'convention', and 'info' which contain the number of messages in each
107# category, as well as 'statement' which is the total number of statements
108# analyzed. This score is used by the global evaluation report (RP0004).
109evaluation=max(0, 0 if fatal else 10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10))
110
111# Template used to display messages. This is a python new-style format string
112# used to format the message information. See doc for all details.
113msg-template=
114
115# Set the output format. Available formats are text, parseable, colorized, json
116# and msvs (visual studio). You can also give a reporter class, e.g.
117# mypackage.mymodule.MyReporterClass.
118#output-format=
119
120# Tells whether to display a full report or only the messages.
121reports=yes
122
123# Activate the evaluation score.
124score=yes
125
126
127[MESSAGES CONTROL]
128
129# Only show warnings with the listed confidence levels. Leave empty to show
130# all. Valid levels: HIGH, CONTROL_FLOW, INFERENCE, INFERENCE_FAILURE,
131# UNDEFINED.
132confidence=HIGH,
133CONTROL_FLOW,
134INFERENCE,
135INFERENCE_FAILURE,
136UNDEFINED
137
138# Disable the message, report, category or checker with the given id(s). You
139# can either give multiple identifiers separated by comma (,) or put this
140# option multiple times (only on the command line, not in the configuration
141# file where it should appear only once). You can also use "--disable=all" to
142# disable everything first and then re-enable specific checks. For example, if
143# you want to run only the similarities checker, you can use "--disable=all
144# --enable=similarities". If you want to run only the classes checker, but have
145# no Warning level messages displayed, use "--disable=all --enable=classes
146# --disable=W".
147disable=raw-checker-failed,
148bad-inline-option,
149locally-disabled,
150file-ignored,
151suppressed-message,
152useless-suppression,
153deprecated-pragma,
154use-symbolic-message-instead,
155invalid-name,
156wrong-import-order,
157import-error,
158undefined-variable
159
160# Enable the message, report, category or checker with the given id(s). You can
161# either give multiple identifier separated by comma (,) or put this option
162# multiple time (only on the command line, not in the configuration file where
163# it should appear only once). See also the "--disable" option for examples.
164enable=c-extension-no-member
165
166
167[BASIC]
168
169# Naming style matching correct argument names.
170argument-naming-style=snake_case
171
172# Regular expression matching correct argument names. Overrides argument-
173# naming-style. If left empty, argument names will be checked with the set
174# naming style.
175#argument-rgx=
176
177# Naming style matching correct attribute names.
178attr-naming-style=snake_case
179
180# Regular expression matching correct attribute names. Overrides attr-naming-
181# style. If left empty, attribute names will be checked with the set naming
182# style.
183#attr-rgx=
184
185# Bad variable names which should always be refused, separated by a comma.
186bad-names=foo,
187bar,
188baz,
189toto,
190tutu,
191tata
192
193# Bad variable names regexes, separated by a comma. If names match any regex,
194# they will always be refused
195bad-names-rgxs=
196
197# Naming style matching correct class attribute names.
198class-attribute-naming-style=any
199
200# Regular expression matching correct class attribute names. Overrides class-
201# attribute-naming-style. If left empty, class attribute names will be checked
202# with the set naming style.
203#class-attribute-rgx=
204
205# Naming style matching correct class constant names.
206class-const-naming-style=UPPER_CASE
207
208# Regular expression matching correct class constant names. Overrides class-
209# const-naming-style. If left empty, class constant names will be checked with
210# the set naming style.
211#class-const-rgx=
212
213# Naming style matching correct class names.
214class-naming-style=PascalCase
215
216# Regular expression matching correct class names. Overrides class-naming-
217# style. If left empty, class names will be checked with the set naming style.
218#class-rgx=
219
220# Naming style matching correct constant names.
221const-naming-style=UPPER_CASE
222
223# Regular expression matching correct constant names. Overrides const-naming-
224# style. If left empty, constant names will be checked with the set naming
225# style.
226#const-rgx=
227
228# Minimum line length for functions/classes that require docstrings, shorter
229# ones are exempt.
230docstring-min-length=4
231
232# Naming style matching correct function names.
233function-naming-style=snake_case
234
235# Regular expression matching correct function names. Overrides function-
236# naming-style. If left empty, function names will be checked with the set
237# naming style.
238#function-rgx=
239
240# Good variable names which should always be accepted, separated by a comma.
241good-names=i,
242j,
243k,
244ex,
245Run,
246_
247
248# Good variable names regexes, separated by a comma. If names match any regex,
249# they will always be accepted
250good-names-rgxs=
251
252# Include a hint for the correct naming format with invalid-name.
253include-naming-hint=no
254
255# Naming style matching correct inline iteration names.
256inlinevar-naming-style=any
257
258# Regular expression matching correct inline iteration names. Overrides
259# inlinevar-naming-style. If left empty, inline iteration names will be checked
260# with the set naming style.
261#inlinevar-rgx=
262
263# Naming style matching correct method names.
264method-naming-style=snake_case
265
266# Regular expression matching correct method names. Overrides method-naming-
267# style. If left empty, method names will be checked with the set naming style.
268#method-rgx=
269
270# Naming style matching correct module names.
271module-naming-style=snake_case
272
273# Regular expression matching correct module names. Overrides module-naming-
274# style. If left empty, module names will be checked with the set naming style.
275#module-rgx=
276
277# Colon-delimited sets of names that determine each other's naming style when
278# the name regexes allow several styles.
279name-group=
280
281# Regular expression which should only match function or class names that do
282# not require a docstring.
283no-docstring-rgx=^_
284
285# List of decorators that produce properties, such as abc.abstractproperty. Add
286# to this list to register other decorators that produce valid properties.
287# These decorators are taken in consideration only for invalid-name.
288property-classes=abc.abstractproperty
289
290# Regular expression matching correct type variable names. If left empty, type
291# variable names will be checked with the set naming style.
292#typevar-rgx=
293
294# Naming style matching correct variable names.
295variable-naming-style=snake_case
296
297# Regular expression matching correct variable names. Overrides variable-
298# naming-style. If left empty, variable names will be checked with the set
299# naming style.
300#variable-rgx=
301
302
303[CLASSES]
304
305# Warn about protected attribute access inside special methods
306check-protected-access-in-special-methods=no
307
308# List of method names used to declare (i.e. assign) instance attributes.
309defining-attr-methods=__init__,
310__new__,
311setUp,
312__post_init__
313
314# List of member names, which should be excluded from the protected access
315# warning.
316exclude-protected=_asdict,
317_fields,
318_replace,
319_source,
320_make
321
322# List of valid names for the first argument in a class method.
323valid-classmethod-first-arg=cls
324
325# List of valid names for the first argument in a metaclass class method.
326valid-metaclass-classmethod-first-arg=cls
327
328
329[REFACTORING]
330
331# Maximum number of nested blocks for function / method body
332max-nested-blocks=5
333
334# Complete name of functions that never returns. When checking for
335# inconsistent-return-statements if a never returning function is called then
336# it will be considered as an explicit return statement and no message will be
337# printed.
338never-returning-functions=sys.exit,argparse.parse_error
339
340
341[DESIGN]
342
343# List of regular expressions of class ancestor names to ignore when counting
344# public methods (see R0903)
345exclude-too-few-public-methods=
346
347# List of qualified class names to ignore when counting class parents (see
348# R0901)
349ignored-parents=
350
351# Maximum number of arguments for function / method.
352max-args=5
353
354# Maximum number of attributes for a class (see R0902).
355max-attributes=15
356
357# Maximum number of boolean expressions in an if statement (see R0916).
358max-bool-expr=5
359
360# Maximum number of branch for function / method body.
361max-branches=12
362
363# Maximum number of locals for function / method body.
364max-locals=15
365
366# Maximum number of parents for a class (see R0901).
367max-parents=7
368
369# Maximum number of public methods for a class (see R0904).
370max-public-methods=20
371
372# Maximum number of return / yield for function / method body.
373max-returns=6
374
375# Maximum number of statements in function / method body.
376max-statements=50
377
378# Minimum number of public methods for a class (see R0903).
379min-public-methods=1
380
381
382[EXCEPTIONS]
383
384# Exceptions that will emit a warning when caught.
385overgeneral-exceptions=builtins.BaseException,
386builtins.Exception
387
388
389[FORMAT]
390
391# Expected format of line ending, e.g. empty (any line ending), LF or CRLF.
392expected-line-ending-format=
393
394# Regexp for a line that is allowed to be longer than the limit.
395ignore-long-lines=^\s*(# )?<?https?://\S+>?$
396
397# Number of spaces of indent required inside a hanging or continued line.
398indent-after-paren=4
399
400# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
401# tab).
402indent-string=' '
403
404# Maximum number of characters on a single line.
405max-line-length=100
406
407# Maximum number of lines in a module.
408max-module-lines=1000
409
410# Allow the body of a class to be on the same line as the declaration if body
411# contains single statement.
412single-line-class-stmt=no
413
414# Allow the body of an if to be on the same line as the test if there is no
415# else.
416single-line-if-stmt=no
417
418
419[IMPORTS]
420
421# List of modules that can be imported at any level, not just the top level
422# one.
423allow-any-import-level=
424
425# Allow wildcard imports from modules that define __all__.
426allow-wildcard-with-all=no
427
428# Deprecated modules which should not be used, separated by a comma.
429deprecated-modules=PySide2
430
431# Output a graph (.gv or any supported image format) of external dependencies
432# to the given file (report RP0402 must not be disabled).
433ext-import-graph=
434
435# Output a graph (.gv or any supported image format) of all (i.e. internal and
436# external) dependencies to the given file (report RP0402 must not be
437# disabled).
438import-graph=
439
440# Output a graph (.gv or any supported image format) of internal dependencies
441# to the given file (report RP0402 must not be disabled).
442int-import-graph=
443
444# Force import order to recognize a module as part of the standard
445# compatibility libraries.
446known-standard-library=
447
448# Force import order to recognize a module as part of a third party library.
449known-third-party=enchant
450
451# Couples of modules and preferred modules, separated by a comma.
452preferred-modules=
453
454
455[LOGGING]
456
457# The type of string formatting that logging methods do. `old` means using %
458# formatting, `new` is for `{}` formatting.
459logging-format-style=old
460
461# Logging modules to check that the string format arguments are in logging
462# function parameter format.
463logging-modules=logging
464
465
466[MISCELLANEOUS]
467
468# List of note tags to take in consideration, separated by a comma.
469notes=FIXME,
470XXX,
471TODO
472
473# Regular expression of note tags to take in consideration.
474notes-rgx=
475
476
477[SIMILARITIES]
478
479# Comments are removed from the similarity computation
480ignore-comments=yes
481
482# Docstrings are removed from the similarity computation
483ignore-docstrings=yes
484
485# Imports are removed from the similarity computation
486ignore-imports=yes
487
488# Signatures are removed from the similarity computation
489ignore-signatures=yes
490
491# Minimum lines number of a similarity.
492min-similarity-lines=4
493
494
495[SPELLING]
496
497# Limits count of emitted suggestions for spelling mistakes.
498max-spelling-suggestions=4
499
500# Spelling dictionary name. Available dictionaries: none. To make it work,
501# install the 'python-enchant' package.
502spelling-dict=
503
504# List of comma separated words that should be considered directives if they
505# appear at the beginning of a comment and should not be checked.
506spelling-ignore-comment-directives=fmt: on,fmt: off,noqa:,noqa,nosec,isort:skip,mypy:
507
508# List of comma separated words that should not be checked.
509spelling-ignore-words=
510
511# A path to a file that contains the private dictionary; one word per line.
512spelling-private-dict-file=
513
514# Tells whether to store unknown words to the private dictionary (see the
515# --spelling-private-dict-file option) instead of raising a message.
516spelling-store-unknown-words=no
517
518
519[STRING]
520
521# This flag controls whether inconsistent-quotes generates a warning when the
522# character used as a quote delimiter is used inconsistently within a module.
523check-quote-consistency=no
524
525# This flag controls whether the implicit-str-concat should generate a warning
526# on implicit string concatenation in sequences defined over several lines.
527check-str-concat-over-line-jumps=no
528
529
530[TYPECHECK]
531
532# List of decorators that produce context managers, such as
533# contextlib.contextmanager. Add to this list to register other decorators that
534# produce valid context managers.
535contextmanager-decorators=contextlib.contextmanager
536
537# List of members which are set dynamically and missed by pylint inference
538# system, and so shouldn't trigger E1101 when accessed. Python regular
539# expressions are accepted.
540generated-members=
541
542# Tells whether to warn about missing members when the owner of the attribute
543# is inferred to be None.
544ignore-none=yes
545
546# This flag controls whether pylint should warn about no-member and similar
547# checks whenever an opaque object is returned when inferring. The inference
548# can return multiple potential results while evaluating a Python object, but
549# some branches might not be evaluated, which results in partial inference. In
550# that case, it might be useful to still emit no-member and other checks for
551# the rest of the inferred objects.
552ignore-on-opaque-inference=yes
553
554# List of symbolic message names to ignore for Mixin members.
555ignored-checks-for-mixins=no-member,
556not-async-context-manager,
557not-context-manager,
558attribute-defined-outside-init
559
560# List of class names for which member attributes should not be checked (useful
561# for classes with dynamically set attributes). This supports the use of
562# qualified names.
563ignored-classes=optparse.Values,thread._local,_thread._local,argparse.Namespace
564
565# Show a hint with possible names when a member name was not found. The aspect
566# of finding the hint is based on edit distance.
567missing-member-hint=yes
568
569# The minimum edit distance a name should have in order to be considered a
570# similar match for a missing member name.
571missing-member-hint-distance=1
572
573# The total number of similar names that should be taken in consideration when
574# showing a hint for a missing member.
575missing-member-max-choices=1
576
577# Regex pattern to define which classes are considered mixins.
578mixin-class-rgx=.*[Mm]ixin
579
580# List of decorators that change the signature of a decorated function.
581signature-mutators=
582
583
584[VARIABLES]
585
586# List of additional names supposed to be defined in builtins. Remember that
587# you should avoid defining new builtins when possible.
588additional-builtins=
589
590# Tells whether unused global variables should be treated as a violation.
591allow-global-unused-variables=yes
592
593# List of names allowed to shadow builtins
594allowed-redefined-builtins=
595
596# List of strings which can identify a callback function by name. A callback
597# name must start or end with one of those strings.
598callbacks=cb_,
599_cb
600
601# A regular expression matching the name of dummy variables (i.e. expected to
602# not be used).
603dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_
604
605# Argument names that match this expression will be ignored. Default to name
606# with leading underscore.
607ignored-argument-names=_.*|^ignored_|^unused_
608
609# Tells whether we should check for unused import in __init__ files.
610init-import=no
611
612# List of qualified module names which can have objects that can redefine
613# builtins.
614redefining-builtins-modules=six.moves,past.builtins,future.builtins,builtins,io
615