Skip to content

Commit 360f722

Browse files
Heavier faq, ligther intro
1 parent 9e6a14c commit 360f722

File tree

2 files changed

+56
-58
lines changed

2 files changed

+56
-58
lines changed

doc/faq.rst

+52-4
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,59 @@ Frequently Asked Questions
1212
1.1 What is Pylint?
1313
--------------------
1414

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+
1867

19-
.. _`static code checker`: https://en.wikipedia.org/wiki/Static_code_analysis
2068

2169

2270
2. Installation

doc/intro.rst

+4-54
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,13 @@
1-
.. -*- coding: utf-8 -*-
2-
31
==============
42
Introduction
53
==============
64

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

56-
* manage the configuration through a configuration file. With the option
57-
``generate-toml-config`` you can create a piece of ``.toml`` text to put
58-
in your ``pyproject.toml`` file.
9+
.. _`static code checker`: https://en.wikipedia.org/wiki/Static_code_analysis
5910

60-
.. _bug reports, feedback:
6111

6212
Bug reports, feedback
6313
---------------------

0 commit comments

Comments
 (0)