Skip to content

Commit

Permalink
[doc] Move the additional command section to user guide
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-Sassoulas committed May 18, 2022
1 parent 7ade71a commit 55dbbf6
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 49 deletions.
1 change: 1 addition & 0 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"messages/messages_introduction": "user_guide/messages/index.html",
"messages/messages_list": "user_guide/messages/messages_overview.html",
"user_guide/message-control": "user_guide/messages/message_control.html",
"additional_commands/index": "user_guide/additional_commands/index.html",
}

# Add any paths that contain templates here, relative to this directory.
Expand Down
1 change: 0 additions & 1 deletion doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ re-evaluate and re-enable messages as your priorities evolve.
how_tos/index.rst
technical_reference/index.rst
development_guide/index.rst
additional_commands/index.rst
faq
contact
whatsnew/index.rst
12 changes: 12 additions & 0 deletions doc/user_guide/additional_commands/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Additional Commands
===================

Pylint ships with some additional tools that can be executed from the command line once Pylint
itself is installed.

.. toctree::
:maxdepth: 1
:titlesonly:

pyreverse.rst
symilar.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@

Additional Commands
===================

Pylint ships with some additional tools that can be executed from the command line once Pylint itself is installed.


Pyreverse
---------

Expand Down Expand Up @@ -35,7 +28,7 @@ Example diagrams generated with the ``.puml`` output format are shown below.
Class Diagram
.............

.. image:: ../media/pyreverse_example_classes.png
.. image:: ../../media/pyreverse_example_classes.png
:width: 625
:height: 589
:alt: Class diagram generated by pyreverse
Expand All @@ -45,7 +38,7 @@ Class Diagram
Package Diagram
...............

.. image:: ../media/pyreverse_example_packages.png
.. image:: ../../media/pyreverse_example_packages.png
:width: 344
:height: 177
:alt: Package diagram generated by pyreverse
Expand All @@ -64,46 +57,8 @@ For example, running::

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

.. image:: ../media/ClassChecker_diagram.png
.. image:: ../../media/ClassChecker_diagram.png
:width: 757
:height: 1452
:alt: Package diagram generated by pyreverse
:align: center


Symilar
-------

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
Pylint's ``duplicate-code`` message.
It can be invoked with::

symilar [-d|--duplicates min_duplicated_lines] [-i|--ignore-comments] [--ignore-docstrings] [--ignore-imports] [--ignore-signatures] file1...

All files that shall be checked have to be passed in explicitly, e.g.::

symilar foo.py, bar.py, subpackage/spam.py, subpackage/eggs.py

``symilar`` produces output like the following::

17 similar lines in 2 files
==tests/data/clientmodule_test.py:3
==tests/data/suppliermodule_test.py:12
class Ancestor:
""" Ancestor method """
__implements__ = (Interface,)
cls_member = DoNothing()

def __init__(self, value):
local_variable = 0
self.attr = 'this method shouldn\'t have a docstring'
self.__value = value

def get_value(self):
""" nice docstring ;-) """
return self.__value

def set_value(self, value):
self.__value = value
return 'this method shouldn\'t have a docstring'
TOTAL lines=58 duplicates=17 percent=29.31
36 changes: 36 additions & 0 deletions doc/user_guide/additional_commands/symilar.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
Symilar
-------

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
Pylint's ``duplicate-code`` message.
It can be invoked with::

symilar [-d|--duplicates min_duplicated_lines] [-i|--ignore-comments] [--ignore-docstrings] [--ignore-imports] [--ignore-signatures] file1...

All files that shall be checked have to be passed in explicitly, e.g.::

symilar foo.py, bar.py, subpackage/spam.py, subpackage/eggs.py

``symilar`` produces output like the following::

17 similar lines in 2 files
==tests/data/clientmodule_test.py:3
==tests/data/suppliermodule_test.py:12
class Ancestor:
""" Ancestor method """
__implements__ = (Interface,)
cls_member = DoNothing()

def __init__(self, value):
local_variable = 0
self.attr = 'this method shouldn\'t have a docstring'
self.__value = value

def get_value(self):
""" nice docstring ;-) """
return self.__value

def set_value(self, value):
self.__value = value
return 'this method shouldn\'t have a docstring'
TOTAL lines=58 duplicates=17 percent=29.31
1 change: 1 addition & 0 deletions doc/user_guide/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ User Guide

installation
run
additional_commands/index.rst
output
messages/index
options
Expand Down

0 comments on commit 55dbbf6

Please sign in to comment.