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.1-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.1-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.
Metadata
Release files for artifact-lint-py 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| artifact_lint_py-1.0.1.tar.gz | 9.1 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| artifact_lint_py-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 19.8 kB
Release files / artifact_lint_py-1.0.1.tar.gz
| Download URL | artifact_lint_py-1.0.1.tar.gz |
|---|---|
| Size | 9.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
73617627887706839915f1aa8450f9217aa375e6367047761603c22e1fd40089
|
|
BLAKE2b-256 checksum How to use checksums |
54ed77aef477bf3e990957ef42c6c4e272c8331bf5713110f5378c1c184f7ac8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.3
|
Release files / artifact_lint_py-1.0.1-py3-none-any.whl
| Download URL | artifact_lint_py-1.0.1-py3-none-any.whl |
|---|---|
| Size | 10.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f774e12b8199ec8858b3799de5e6f72102b701ef0fa3882c67638c04ebb8e415
|
|
BLAKE2b-256 checksum How to use checksums |
7913647dfc67570c78ba74b8c8995c5af9ca3013a45d11ec02b255c3cc3f2c9d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.3
|
Security for artifact-lint-py 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.