Cleaning
--------

Why do we need it?
^^^^^^^^^^^^^^^^^^

Because we constantly need to clean files which are not needed before starting a new test,
we embedded our cleaning logic.

How does it work?
^^^^^^^^^^^^^^^^^

.. note::
    Want to read the code ? It's here :func:`PyFunceble.output.clean.Clean`!

It has an internal map of what has to be deleted and how.

How to clean?
^^^^^^^^^^^^^

For a simple clean, run PyFunceble with the :code:`--clean` argument.

For a complete cleaning, run PyFunceble with the :code:`--clean-all` argument.


Differences between simple and complete cleaning?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The :code:`--clean` logic cleans the :code:`output/` directory along with the :code:`pyfunceble_tested` table
when the :code:`mariadb` or :code:`mysql` database type are choosen.

The :code:`--clean-all` deletes all files generated along with the content of all database tables
when the :code:`mariadb` or :code:`mysql` database type are choosen.

.. warning::
    :code:`--clean-all` does not delete the following files (even if generated by us):

    * :code:`.pyfunceble-env`
    * :code:`whois_db.json`

.. warning::
    :code:`--clean-all` does not delete the content of the following tables:

    * :code:`pyfunceble_whois`