<commit_before>.. _foremast_config:

========================
foremast.cfg / config.py
========================

.. contents::
   :local:

Purpose
-------

This configuration holds information necessary for running foremast such as auth
tokens, URLs, whitelists etc

Example Configuration
---------------------

.. literalinclude:: ../../src/foremast/templates/configs/foremast.cfg.example
.. literalinclude:: ../../src/foremast/templates/configs/config.py.example

Configuration Locations
-----------------------

Foremast will look in the following locations, in order, for the
``foremast.cfg`` or ``config.py`` config file.

1. ``./.foremast/foremast.cfg``
2. ``~/.foremast/.foremast.cfg``
3. ``/etc/foremast/foremast/cfg``
4. ``./config.py``

Configuration Details
---------------------

``[base]``<commit_msg>Added docs for FOREMAST_CONFIG_FILE<commit_after>.. _foremast_config:

========================
foremast.cfg / config.py
========================

.. contents::
   :local:

Purpose
-------

This configuration holds information necessary for running foremast such as auth
tokens, URLs, whitelists etc

Example Configuration
---------------------

.. literalinclude:: ../../src/foremast/templates/configs/foremast.cfg.example
.. literalinclude:: ../../src/foremast/templates/configs/config.py.example

Configuration Locations
-----------------------

Foremast will look in the following locations, in order, for the
``foremast.cfg`` or ``config.py`` config file.

1. ``./.foremast/foremast.cfg``
2. ``~/.foremast/.foremast.cfg``
3. ``/etc/foremast/foremast/cfg``
4. ``./config.py``

Specifying a Configuration file
-------------------------------

Optionally, it is possible to specify the location of a configuration file for Foremast to use by 
setting the ``FOREMAST_CONFIG_FILE`` environment variable.  This is useful if you do not store your 
config file in one of the locations listed above, or if you need to toggle between multiple
configuration files to support different configurations.  

Example: A config file for two different Spinnaker Instances

.. code-block:: console

    # Generate pipeline for spinnaker1
    FOREMAST_CONFIG_FILE=config-spinnaker1.py
    foremast generate pipeline
    # Generate pipeline for spinnaker2
    FOREMAST_CONFIG_FILE=config-spinnaker2.py
    foremast generate pipeline



Configuration Details
---------------------

``[base]``
{'fraction_non_alphanumeric': 0.2113855169526999, 'fraction_numerical': 0.0050230221850146506, 'mean_word_length': 3.0439932318104908, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '361018', 'n_tokens_mistral': 683, 'n_tokens_neox': 663, 'n_words': 201}