:py:mod:`mass_driver.drivers.bricks`
====================================

.. py:module:: mass_driver.drivers.bricks

.. autodoc2-docstring:: mass_driver.drivers.bricks
   :parser: myst
   :allowtitles:

Module Contents
---------------

Classes
~~~~~~~

.. list-table::
   :class: autosummary longtable
   :align: left

   * - :py:obj:`SingleFileEditor <mass_driver.drivers.bricks.SingleFileEditor>`
     - .. autodoc2-docstring:: mass_driver.drivers.bricks.SingleFileEditor
          :parser: myst
          :summary:
   * - :py:obj:`GlobFileEditor <mass_driver.drivers.bricks.GlobFileEditor>`
     - .. autodoc2-docstring:: mass_driver.drivers.bricks.GlobFileEditor
          :parser: myst
          :summary:

Functions
~~~~~~~~~

.. list-table::
   :class: autosummary longtable
   :align: left

   * - :py:obj:`process_outcomes <mass_driver.drivers.bricks.process_outcomes>`
     - .. autodoc2-docstring:: mass_driver.drivers.bricks.process_outcomes
          :parser: myst
          :summary:
   * - :py:obj:`replace_many <mass_driver.drivers.bricks.replace_many>`
     - .. autodoc2-docstring:: mass_driver.drivers.bricks.replace_many
          :parser: myst
          :summary:

API
~~~

.. py:class:: SingleFileEditor
   :canonical: mass_driver.drivers.bricks.SingleFileEditor

   Bases: :py:obj:`mass_driver.models.patchdriver.PatchDriver`

   .. autodoc2-docstring:: mass_driver.drivers.bricks.SingleFileEditor
      :parser: myst

   .. py:attribute:: target_file
      :canonical: mass_driver.drivers.bricks.SingleFileEditor.target_file
      :type: str
      :value: None

      .. autodoc2-docstring:: mass_driver.drivers.bricks.SingleFileEditor.target_file
         :parser: myst

   .. py:method:: process_file(file_contents: str) -> str | mass_driver.models.patchdriver.PatchResult
      :canonical: mass_driver.drivers.bricks.SingleFileEditor.process_file
      :abstractmethod:

      .. autodoc2-docstring:: mass_driver.drivers.bricks.SingleFileEditor.process_file
         :parser: myst

   .. py:method:: run(repo: mass_driver.models.repository.ClonedRepo) -> mass_driver.models.patchdriver.PatchResult
      :canonical: mass_driver.drivers.bricks.SingleFileEditor.run

      .. autodoc2-docstring:: mass_driver.drivers.bricks.SingleFileEditor.run
         :parser: myst

.. py:class:: GlobFileEditor
   :canonical: mass_driver.drivers.bricks.GlobFileEditor

   Bases: :py:obj:`mass_driver.models.patchdriver.PatchDriver`

   .. autodoc2-docstring:: mass_driver.drivers.bricks.GlobFileEditor
      :parser: myst

   .. py:attribute:: target_glob
      :canonical: mass_driver.drivers.bricks.GlobFileEditor.target_glob
      :type: str
      :value: None

      .. autodoc2-docstring:: mass_driver.drivers.bricks.GlobFileEditor.target_glob
         :parser: myst

   .. py:attribute:: fail_on_any_error
      :canonical: mass_driver.drivers.bricks.GlobFileEditor.fail_on_any_error
      :type: bool
      :value: True

      .. autodoc2-docstring:: mass_driver.drivers.bricks.GlobFileEditor.fail_on_any_error
         :parser: myst

   .. py:method:: process_file(filename, file_contents: str) -> str | mass_driver.models.patchdriver.PatchResult
      :canonical: mass_driver.drivers.bricks.GlobFileEditor.process_file
      :abstractmethod:

      .. autodoc2-docstring:: mass_driver.drivers.bricks.GlobFileEditor.process_file
         :parser: myst

   .. py:method:: before_run(targets)
      :canonical: mass_driver.drivers.bricks.GlobFileEditor.before_run

      .. autodoc2-docstring:: mass_driver.drivers.bricks.GlobFileEditor.before_run
         :parser: myst

   .. py:method:: run(repo: mass_driver.models.repository.ClonedRepo) -> mass_driver.models.patchdriver.PatchResult
      :canonical: mass_driver.drivers.bricks.GlobFileEditor.run

      .. autodoc2-docstring:: mass_driver.drivers.bricks.GlobFileEditor.run
         :parser: myst

.. py:function:: process_outcomes(outcomes: dict[str, mass_driver.models.patchdriver.PatchResult], fail_on_any_error: bool, logger: logging.Logger)
   :canonical: mass_driver.drivers.bricks.process_outcomes

   .. autodoc2-docstring:: mass_driver.drivers.bricks.process_outcomes
      :parser: myst

.. py:function:: replace_many(file_contents: str, replacements: list[tuple[str, str]]) -> str
   :canonical: mass_driver.drivers.bricks.replace_many

   .. autodoc2-docstring:: mass_driver.drivers.bricks.replace_many
      :parser: myst