Skip to content

Commit

Permalink
Document the default sorting behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
psss committed Jan 6, 2025
1 parent 4533b82 commit 0b852dc
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
20 changes: 20 additions & 0 deletions docs/features.rst
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,26 @@ instead of deleting it completely. To do so, one can set the directive::
By default all leaves have it set to ``true`` (such node is selected)
and branches have set it to ``false`` (such node is not selected).

.. _sort:

Sort
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

By default, when exploring test metadata in the tree, child nodes
are sorted alphabetically by node name. This applies to command
line usage such as ``fmf ls`` or ``fmf show`` as well as for the
:py:meth:`fmf.Tree.climb()` and :py:meth:`fmf.Tree.prune()`
methods.

If the tree content is not created from files on disk but created
manually using the :py:meth:`fmf.Tree.child()` method, the child
order can be preserved by providing the ``sort=False`` parameter
to the :py:meth:`fmf.Tree.climb()` and :py:meth:`fmf.Tree.prune()`
methods.

.. versionadded:: 1.6


.. _virtual:

Virtual
Expand Down
10 changes: 10 additions & 0 deletions docs/releases.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@
======================


fmf-1.6.0
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

When exploring trees using the :py:meth:`fmf.Tree.climb()` and
:py:meth:`fmf.Tree.prune()` methods, optional parameter ``sort``
can be used to preserve the original order in which child nodes
where inserted into the tree. See the :ref:`sort` section for more
details.


fmf-1.5.0
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down

0 comments on commit 0b852dc

Please sign in to comment.