Skip to content

Commit 8a1feee

Browse files
Split the additional commands documentation in two files (#6641)
Co-authored-by: Daniël van Noord <[email protected]>
1 parent a6ae75a commit 8a1feee

File tree

4 files changed

+52
-48
lines changed

4 files changed

+52
-48
lines changed

doc/conf.py

+1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
"support": "contact.html",
6363
"user_guide/ide-integration": "installation.html",
6464
"user_guide/message-control": "user_guide/messages/message_control.html",
65+
"additional_commands/index": "../index.html",
6566
}
6667
for m in redirects:
6768
for r in DIRECTORY_REDIRECT:

doc/index.rst

+8-1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ it's best to start with the ``--errors-only`` flag, then disable
3737
convention and refactor message with ``--disable=C,R`` and progressively
3838
re-evaluate and re-enable messages as your priorities evolve.
3939

40+
41+
Pylint ships with two additional tools:
42+
43+
- :ref:`pyreverse <pyreverse>` (standalone tool that generates package and class diagrams.)
44+
- :ref:`symilar <symilar>` (duplicate code finder that is also integrated in pylint)
45+
4046
.. toctree::
4147
:titlesonly:
4248
:hidden:
@@ -46,7 +52,8 @@ re-evaluate and re-enable messages as your priorities evolve.
4652
how_tos/index.rst
4753
technical_reference/index.rst
4854
development_guide/index.rst
49-
additional_commands/index.rst
55+
pyreverse
56+
symilar
5057
faq
5158
contact
5259
whatsnew/index.rst
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
1-
2-
Additional Commands
3-
===================
4-
5-
Pylint ships with some additional tools that can be executed from the command line once Pylint itself is installed.
6-
1+
.. _pyreverse:
72

83
Pyreverse
94
---------
105

116
``pyreverse`` analyzes your source code and generates package and class diagrams.
7+
128
It supports output to ``.dot``/``.gv``, ``.vcg``, ``.puml``/``.plantuml`` (PlantUML) and ``.mmd``/``.html`` (MermaidJS) file formats.
139
If Graphviz (or the ``dot`` command) is installed, all `output formats supported by Graphviz <https://graphviz.org/docs/outputs/>`_
1410
can be used as well. In this case, ``pyreverse`` first generates a temporary ``.gv`` file, which is then
@@ -35,7 +31,7 @@ Example diagrams generated with the ``.puml`` output format are shown below.
3531
Class Diagram
3632
.............
3733

38-
.. image:: ../media/pyreverse_example_classes.png
34+
.. image:: media/pyreverse_example_classes.png
3935
:width: 625
4036
:height: 589
4137
:alt: Class diagram generated by pyreverse
@@ -45,7 +41,7 @@ Class Diagram
4541
Package Diagram
4642
...............
4743

48-
.. image:: ../media/pyreverse_example_packages.png
44+
.. image:: media/pyreverse_example_packages.png
4945
:width: 344
5046
:height: 177
5147
:alt: Package diagram generated by pyreverse
@@ -64,46 +60,8 @@ For example, running::
6460

6561
will generate the full class and package diagrams for ``pylint``, but will additionally generate a file ``pylint.checkers.classes.ClassChecker.dot``:
6662

67-
.. image:: ../media/ClassChecker_diagram.png
63+
.. image:: media/ClassChecker_diagram.png
6864
:width: 757
6965
:height: 1452
7066
:alt: Package diagram generated by pyreverse
7167
:align: center
72-
73-
74-
Symilar
75-
-------
76-
77-
The console script ``symilar`` finds copy pasted blocks in a set of files. It provides a command line interface to the ``Similar`` class, which includes the logic for
78-
Pylint's ``duplicate-code`` message.
79-
It can be invoked with::
80-
81-
symilar [-d|--duplicates min_duplicated_lines] [-i|--ignore-comments] [--ignore-docstrings] [--ignore-imports] [--ignore-signatures] file1...
82-
83-
All files that shall be checked have to be passed in explicitly, e.g.::
84-
85-
symilar foo.py, bar.py, subpackage/spam.py, subpackage/eggs.py
86-
87-
``symilar`` produces output like the following::
88-
89-
17 similar lines in 2 files
90-
==tests/data/clientmodule_test.py:3
91-
==tests/data/suppliermodule_test.py:12
92-
class Ancestor:
93-
""" Ancestor method """
94-
__implements__ = (Interface,)
95-
cls_member = DoNothing()
96-
97-
def __init__(self, value):
98-
local_variable = 0
99-
self.attr = 'this method shouldn\'t have a docstring'
100-
self.__value = value
101-
102-
def get_value(self):
103-
""" nice docstring ;-) """
104-
return self.__value
105-
106-
def set_value(self, value):
107-
self.__value = value
108-
return 'this method shouldn\'t have a docstring'
109-
TOTAL lines=58 duplicates=17 percent=29.31

doc/symilar.rst

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
.. _symilar:
2+
3+
Symilar
4+
-------
5+
6+
The console script ``symilar`` finds copy pasted blocks in a set of files. It provides a command line interface to the ``Similar`` class, which includes the logic for
7+
Pylint's ``duplicate-code`` message.
8+
It can be invoked with::
9+
10+
symilar [-d|--duplicates min_duplicated_lines] [-i|--ignore-comments] [--ignore-docstrings] [--ignore-imports] [--ignore-signatures] file1...
11+
12+
All files that shall be checked have to be passed in explicitly, e.g.::
13+
14+
symilar foo.py, bar.py, subpackage/spam.py, subpackage/eggs.py
15+
16+
``symilar`` produces output like the following::
17+
18+
17 similar lines in 2 files
19+
==tests/data/clientmodule_test.py:3
20+
==tests/data/suppliermodule_test.py:12
21+
class Ancestor:
22+
""" Ancestor method """
23+
__implements__ = (Interface,)
24+
cls_member = DoNothing()
25+
26+
def __init__(self, value):
27+
local_variable = 0
28+
self.attr = 'this method shouldn\'t have a docstring'
29+
self.__value = value
30+
31+
def get_value(self):
32+
""" nice docstring ;-) """
33+
return self.__value
34+
35+
def set_value(self, value):
36+
self.__value = value
37+
return 'this method shouldn\'t have a docstring'
38+
TOTAL lines=58 duplicates=17 percent=29.31

0 commit comments

Comments
 (0)