@@ -12,11 +12,59 @@ Frequently Asked Questions
12
12
1.1 What is Pylint?
13
13
--------------------
14
14
15
- Pylint is a `static code checker `_, meaning it can analyse your code without
16
- actually running it. Pylint checks for errors, tries to enforce a coding
17
- standard, and tries to enforce a coding style.
15
+ Pylint is a tool that checks for errors in Python code, tries to enforce a
16
+ coding standard and looks for `code smells `_. It can also look for certain type
17
+ errors, it can recommend suggestions about how particular blocks
18
+ can be refactored and can offer you details about the code's complexity.
19
+
20
+ Other similar projects would include pychecker _ (now defunct), pyflakes _,
21
+ flake8 _, and mypy _. The default coding style used by Pylint is close to `PEP 8 `_.
22
+
23
+ Pylint will display a number of messages as it analyzes the code and it can
24
+ also be used for displaying some statistics about the number of warnings and
25
+ errors found in different files. The messages are classified under various
26
+ categories such as errors and warnings.
27
+
28
+ Last but not least, the code is given an overall mark, based on the number and
29
+ severity of the warnings and errors.
30
+
31
+ .. _pychecker : https://pypi.org/project/PyChecker/
32
+ .. _pyflakes : https://github.com/PyCQA/pyflakes
33
+ .. _flake8 : https://gitlab.com/pycqa/flake8/
34
+ .. _mypy : https://github.com/python/mypy
35
+ .. _`PEP 8` : https://peps.python.org/pep-0008/
36
+ .. _`Guido's style guide` : https://www.python.org/doc/essays/styleguide/
37
+ .. _`refactoring book` : https://www.refactoring.com/
38
+ .. _`code smells` : https://martinfowler.com/bliki/CodeSmell.html
39
+
40
+ 1.2 What Pylint is not?
41
+ -----------------------
42
+
43
+ What Pylint says is not to be taken as gospel and Pylint isn't smarter than you
44
+ are: it may warn you about things that you have conscientiously done.
45
+
46
+ Pylint tries hard to report as few false positives as possible for errors, but
47
+ it may be too verbose with warnings. That's for example because it tries to
48
+ detect things that may be dangerous in a context, but are not in others, or
49
+ because it checks for some things that you don't care about. Generally, you
50
+ shouldn't expect Pylint to be totally quiet about your code, so don't
51
+ necessarily be alarmed if it gives you a hell lot of messages for your project!
52
+
53
+ The best way to tackle pylint's verboseness is to:
54
+
55
+ * enable or disable the messages or message categories that you want to be
56
+ activated or not for when pylint is analyzing your code.
57
+ This can be done easily through a command line flag. For instance, disabling
58
+ all convention messages is simple as a ``--disable=C `` option added to pylint
59
+ command.
60
+
61
+ * manage the configuration through a configuration file. With the option
62
+ ``generate-toml-config `` you can create a piece of ``.toml `` text to put
63
+ in your ``pyproject.toml `` file.
64
+
65
+ .. _bug reports, feedback :
66
+
18
67
19
- .. _`static code checker` : https://en.wikipedia.org/wiki/Static_code_analysis
20
68
21
69
22
70
2. Installation
0 commit comments