.. artifact-lint-py documentation master file, created by sphinx-quickstart on Sun Apr 20 10:49:22 2025. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. artifact-lint-py documentation =============================== A python framework for developing artifact linters .. toctree:: :maxdepth: 2 :caption: Reference lint/modules Quick example ============= .. code-block:: python :linenos: from lint.rule import LintRule from lint.result import LintResult from lint.status import LintStatus class IntegerIsEven(LintRule[int]): def lint(self, artifact: int) -> LintResult: if artifact % 2 == 0: return LintResult( status=LintStatus.INFO, message=f"({self.name()}) Integer was even: {artifact}" ) return LintResult( status=LintStatus.ERROR, message=f"({self.name()}) Integer was odd: {artifact}" ) integer_is_even = IntegerIsEven() # Lint an even integer even_result = integer_is_even.lint(2) print(even_result) # Lint an odd integer odd_result = integer_is_even.lint(337) print(odd_result) Installation ============ **Using Pip** Run the following command to install the latest version of this package using pip .. code-block:: shell pip install artifact-lint-py **Local Install** 1. Clone `the source repository `_ 2. Build the project from source following `the build instructions `_ 3. Locate the ``.whl`` (wheel) file in the ``dist`` folder. It should be named something like so: ``artifact_lint_py-1.0.1-py3-none-any.whl`` 4. Run the following command from the root of the repository, replacing the name of the ``.whl`` file if necessary .. code-block:: shell pip install dist/artifact_lint_py-1.0.1-py3-none-any.whl Build ===== From the root of `the source repository `_, execute .. code-block:: shell make build Under the hood, this will execute ``python3 -m build`` and produce a ``.whl`` (wheel) and ``.tgz`` (TAR-GZip archive) file in the ``dist`` subdirectory. Indices and Tables ================== * :ref:`genindex` * :ref:`modindex` * :ref:`search`