A python framework for developing artifact linters
Project description
artifact-lint-py
A python framework for developing artifact linters
Docs: https://whatsacomputertho.github.io/artifact-lint-py/
Contributing: CONTRIBUTING.md
Quick Example
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)
To run this example, simply execute the following from the root of this repository
python3 examples/quick-example.py
Installation
Using Pip
Run the following command to install the latest version of this package
pip install artifact-lint-py
Local Install
- Clone this repository
- Build the project from source
- Locate the
.whl(wheel) file in thedistfolder- It should be named something like so: artifact_lint_py-1.0.0-py3-none-any.whl
- Run the following command from the root of the repository, replacing the name of the
.whlfile if necessarypip install dist/artifact_lint_py-1.0.0-py3-none-any.whl
Build
From the root of this repository, execute
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. For more on this project's make recipes, see CONTRIBUTING.md.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file artifact_lint_py-1.0.0.tar.gz.
File metadata
- Download URL: artifact_lint_py-1.0.0.tar.gz
- Upload date:
- Size: 9.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0cb828bed9a733b3fe5aabd398dcff5a30dbd4faff893a0b8835da340e8db76c
|
|
| MD5 |
a829bc7a8dd7a0586c4bf6aef75547f5
|
|
| BLAKE2b-256 |
a05735905bc9554f3c23c3909eed9b0c70f433d6c8abd120f262bf2968ee8e95
|
File details
Details for the file artifact_lint_py-1.0.0-py3-none-any.whl.
File metadata
- Download URL: artifact_lint_py-1.0.0-py3-none-any.whl
- Upload date:
- Size: 10.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
382c4d0f20a7b4fe90e64bb8e680c5a97c48c9340f5d6815e6944a40f16dae47
|
|
| MD5 |
17fb32c271591b5c741199ebbbfde64d
|
|
| BLAKE2b-256 |
48a8750ac3c7f8151dfc412a56f402b477062a1ee0c3a404ac060e8a598f7882
|