<commit_before>Development Tools
=================

Sanity Checker
--------------

The ``check_sanity.py`` tool does basic code sanity checking on the codebase.
This should be done before pushing.

.. code-block::  shell

   python _misc/check_sanity.py

DocCov
------

The ``doccov.py`` tool checks for docstring coverage and docstring style.

.. code-block::  shell

   python _misc/doccov.py -o report.html shoop


Ensure FK Style
---------------

The ``ensure_fk_style.py`` tool checks that all ``ForeignKey``s are declared
with ``on_delete`` clauses.

.. code-block::  shell

   python _misc/ensure_fk_style.py shoop


Ensure License Headers
----------------------

The ``ensure_license_headers.py`` tool checks that all source files have the requisite
license header.  It can also optionally write the headers to the files by itself.

.. code-block::  shell

   python _misc/ensure_license_headers.py shoop
   # or to write changes:
   python _misc/ensure_license_headers.py -w shoop


Ensure Unicode Literals
-----------------------

The ``ensure_unicode_literals.py`` tool checks that all Python files have the
``from __future import unicode_literals`` statement, to improve Python 2 compatibility.

It can also optionally add these statements itself.

.. code-block::  shell

   python _misc/ensure_unicode_literals.py shoop
   # or to write changes:
   python _misc/ensure_unicode_literals.py -w shoop
<commit_msg>doc/dev_tools: Fix description of check_sanity.py<commit_after>Development Tools
=================

Sanity Checker
--------------

The ``check_sanity.py`` tool does basic text file sanity checking on the
codebase.

.. code-block::  shell

   python _misc/check_sanity.py

DocCov
------

The ``doccov.py`` tool checks for docstring coverage and docstring style.

.. code-block::  shell

   python _misc/doccov.py -o report.html shoop


Ensure FK Style
---------------

The ``ensure_fk_style.py`` tool checks that all ``ForeignKey``s are declared
with ``on_delete`` clauses.

.. code-block::  shell

   python _misc/ensure_fk_style.py shoop


Ensure License Headers
----------------------

The ``ensure_license_headers.py`` tool checks that all source files have the requisite
license header.  It can also optionally write the headers to the files by itself.

.. code-block::  shell

   python _misc/ensure_license_headers.py shoop
   # or to write changes:
   python _misc/ensure_license_headers.py -w shoop


Ensure Unicode Literals
-----------------------

The ``ensure_unicode_literals.py`` tool checks that all Python files have the
``from __future import unicode_literals`` statement, to improve Python 2 compatibility.

It can also optionally add these statements itself.

.. code-block::  shell

   python _misc/ensure_unicode_literals.py shoop
   # or to write changes:
   python _misc/ensure_unicode_literals.py -w shoop

{'fraction_non_alphanumeric': 0.13599719593410445, 'fraction_numerical': 0.0007010164738871364, 'mean_word_length': 3.142235123367199, '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': '7202240', 'n_tokens_mistral': 871, 'n_tokens_neox': 812, 'n_words': 295}