GitLab CI ShellCheck pre-commit hook
┏━╸╻ ┏━┓┏━╸┏━┓┏━╸
┃╺┓┃ ┗━┓┃ ┣━┛┃
┗━┛┗━╸┗━┛┗━╸╹ ┗━╸
This is a small project to help with maintaining clean GitLab CI scripts.
Supported
Dependencies
It's required to install shellcheck and make it available in $PATH. You can specify the feature (aka extra) "shellcheck" and it
will be installed via the optional dependency shellcheck-py. (pip install glscpc[shellcheck])
All Python dependencies (see pyproject.toml) are installed by pip when you install the package.
When setting up a development environment, use hatch to set up the dependencies. Running hatch build will do the heavy lifting for you.
For Pycham support run hatch env run which python and add its output as an "existing" virtualenv interpreter.
Usage
This script should be run after you check that the yml file is well-formed and valid.
The intended use is via the provided hook in the repo:
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: main
hooks:
# Check if all yaml files are well-formed
- id: check-yaml
- repo: https://github.com/bjd2385/pre-commit-gitlabci-lint
rev: master
hooks:
# Linting API requires you set the project ID correctly and also have an API token configured in your environment!
# You also should skip this step in the CI, since if it was invalid, the CI wouldn't be running anyway.
- id: gitlabci-lint
args: ['-p', '49052761']
# This repo <3
- repo: https://gitlab.com/Qteal/oss/gitlabci-shellcheck-precommit
rev: main
hooks:
- id: glscpc
The pre-commit hook automatically installs shellcheck, so it's not required to pre-install it in your CI for example.
Run pre-commit autoupdate to replace the branch references with the latest tags.
But it's also possible to install the Python package in your environment and run the glscpc script.
You can install the package via pypi (only tagged versions / releases are pushed) or the GitLab package registry (includes dev builds).
To automatically download a shellcheck binary as a dependency, use pip install glscpc[shellcheck].
Run glscpc --help for up-to-date usage information and the help text.
Metadata
Release files for glscpc 0.4.0
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 | Actions |
|---|---|---|---|---|
| glscpc-0.4.0.tar.gz | 19.6 kB | Without provenance | Details for glscpc-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| glscpc-0.4.0-py3-none-any.whl | Python 3 | none | any | Details for glscpc-0.4.0-py3-none-any.whl |
Total release size: 35.7 kB
Release files / glscpc-0.4.0.tar.gz
| Download URL | glscpc-0.4.0.tar.gz |
|---|---|
| Size | 19.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
928f47a62d5b69565a771287f569786446773a0c84f8aa8eb5df3e7afab1dacd
|
|
BLAKE2b-256 checksum How to use checksums |
576c3f87a873a78a83bef4e0324f935eb6c36b93d4cf836dfd5c59be6b6650e4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-httpx/0.26.0
|
Release files / glscpc-0.4.0-py3-none-any.whl
| Download URL | glscpc-0.4.0-py3-none-any.whl |
|---|---|
| Size | 16.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
84910ab8d3bf161f92bc00af60e8cd16789b5d79c26c364ed1b5a8454330970b
|
|
BLAKE2b-256 checksum How to use checksums |
add809ef4ca2797887138f4bc241d6e3098e7ccc1b20755d64f7f6c6fc9fcfbf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-httpx/0.26.0
|
Security for glscpc 0.4.0
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.