<commit_before>yaml4rst introduction
=====================

| |Build Status| |Read The Docs| |CII Best Practices| |Code Coverage Status|
| |Version| |License| |Python versions| |dev status| |pypi monthly downloads|

yaml4rst is a linting/checking/reformatting tool for YAML files documented with
inline RST which goes hand in hand with yaml2rst_.

It has been written to help with keeping the ``defaults/main.yml`` file in
Ansible roles maintained in DebOps_ up-to-date and to assist with writing or
including new roles. DebOps uses Sphinx to generate Ansible role documentation
which also includes the default role variables. Refer to `debops/docs`_ for
details.

Usage
-----

The typical use case for this program is to improve the defaults YAML file of
Ansible roles.

The recommended way to do this is to commit all your changes in the repository
of the role, then run:

.. code-block:: bash

   yaml4rst -e 'ansible_full_role_name=ROLE_OWNER.ROLE_NAME' defaults/main.yml -i

from the root of the role repository. Be sure to replace
``ROLE_OWNER.ROLE_NAME`` with the particular Ansible role name.

This will check and reformat the ``defaults/main.yml`` file in place.

Now you can check the reformatted file with a diffing/editing tool of your choosing
and fix any warning which ``yaml4rst`` might have emitted.

Refer to ``input_files`` and ``output_files`` in the `tests directory`_ for
automatically tested examples of input and output files.

Note that for continues usage yaml4rst is called from debops-optimize_.

Features
--------

.. Redundant. Places: /README.rst and /yaml4rst/reformatter.py

Checks for:

* Reasonable variable namespace
* Undocumented variables

Automatically fixes:<commit_msg>Improve spelling in README<commit_after>yaml4rst introduction
=====================

| |Build Status| |Read The Docs| |CII Best Practices| |Code Coverage Status|
| |Version| |License| |Python versions| |dev status| |pypi monthly downloads|

yaml4rst is a linting/checking/reformatting tool for YAML files documented with
inline RST which goes hand in hand with yaml2rst_.

It has been written to help with keeping the ``defaults/main.yml`` file in
Ansible roles, maintained in DebOps_, up-to-date and to assist with writing or
including new roles. DebOps uses Sphinx to generate Ansible role documentation
which also includes the default role variables. Refer to `debops/docs`_ for
details.

Usage
-----

The typical use case for this program is to improve the defaults YAML file of
Ansible roles.

The recommended way to do this is to commit all your changes in the repository
of the role, then run:

.. code-block:: bash

   yaml4rst -e 'ansible_full_role_name=ROLE_OWNER.ROLE_NAME' defaults/main.yml -i

from the root of the role repository. Be sure to replace
``ROLE_OWNER.ROLE_NAME`` with the particular Ansible role name.

This will check and reformat the ``defaults/main.yml`` file in place.

Now you can check the reformatted file with a diffing/editing tool of your choosing
and fix any warning which ``yaml4rst`` might have emitted.

Refer to ``input_files`` and ``output_files`` in the `tests directory`_ for
automatically tested examples of input and output files.

Note that for continues usage yaml4rst is invoked from debops-optimize_ when
yaml4rst is installed so you might want to try debops-optimize_.

Features
--------

.. Redundant. Places: /README.rst and /yaml4rst/reformatter.py

Checks for:

* Reasonable variable namespace
* Undocumented variables

Automatically fixes:
{'fraction_non_alphanumeric': 0.07845934379457917, 'fraction_numerical': 0.0042796005706134095, 'mean_word_length': 4.5474683544303796, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3036583', 'n_tokens_mistral': 1047, 'n_tokens_neox': 971, 'n_words': 467}