Add pre-commit hooks + CI
Signed-off-by: Chris Evich <cevich@redhat.com>
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1 +0,0 @@
|
||||
/.pre-commit-config.yaml
|
||||
@@ -1,11 +1,23 @@
|
||||
---
|
||||
|
||||
default:
|
||||
image: quay.io/buildah/stable:v1.31.0
|
||||
image: quay.io/buildah/stable:v1.32
|
||||
tags:
|
||||
- docker
|
||||
- linux
|
||||
|
||||
workflow:
|
||||
rules:
|
||||
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
||||
- if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
|
||||
when: never
|
||||
- if: $CI_COMMIT_BRANCH
|
||||
|
||||
include:
|
||||
- component: gitlab.com/blue42u/ci.pre-commit/lite@0.2.0
|
||||
inputs:
|
||||
job_stage: test
|
||||
|
||||
envars:
|
||||
stage: test
|
||||
script: |
|
||||
@@ -14,6 +26,9 @@ envars:
|
||||
|
||||
commit_check:
|
||||
stage: test
|
||||
rules:
|
||||
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
||||
- when: never
|
||||
variables:
|
||||
BADRX: '^(squash!)|(fixup!)'
|
||||
script: |
|
||||
|
||||
48
.pre-commit-config.yaml
Normal file
48
.pre-commit-config.yaml
Normal file
@@ -0,0 +1,48 @@
|
||||
default_language_version:
|
||||
python: python3
|
||||
default_install_hook_types: [pre-commit, commit-msg]
|
||||
default_stages: [pre-commit]
|
||||
|
||||
repos:
|
||||
- repo: https://github.com/executablebooks/mdformat
|
||||
rev: '0.7.17'
|
||||
hooks:
|
||||
- id: mdformat
|
||||
additional_dependencies:
|
||||
- mdformat-footnote
|
||||
- mdformat-tables
|
||||
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v4.5.0
|
||||
hooks:
|
||||
- id: trailing-whitespace
|
||||
- id: end-of-file-fixer
|
||||
- id: fix-byte-order-marker
|
||||
- id: mixed-line-ending
|
||||
- id: check-executables-have-shebangs
|
||||
- id: check-symlinks
|
||||
- id: destroyed-symlinks
|
||||
- id: check-merge-conflict
|
||||
- id: check-case-conflict
|
||||
- id: no-commit-to-branch
|
||||
args: [--branch, main]
|
||||
- id: check-yaml
|
||||
|
||||
- repo: https://github.com/python-jsonschema/check-jsonschema
|
||||
rev: '0.28.0'
|
||||
hooks:
|
||||
# Validate the GitLab CI scripts against the schema. Doesn't catch everything but helps.
|
||||
- id: check-gitlab-ci
|
||||
files: '.*\.gitlab-ci\.yml$'
|
||||
|
||||
- repo: https://github.com/jumanjihouse/pre-commit-hooks
|
||||
rev: '3.0.0'
|
||||
hooks:
|
||||
- id: forbid-binary
|
||||
- id: require-ascii
|
||||
|
||||
- repo: meta
|
||||
hooks:
|
||||
# Un-comment (maybe temporarily) to check which hooks don't apply.
|
||||
# - id: check-hooks-apply
|
||||
- id: check-useless-excludes
|
||||
@@ -75,7 +75,7 @@ for `podman`. However, some container images you may want to use for jobs
|
||||
At the same time, most distributions also set `65536` as the default maximum
|
||||
number (including ID `0`) of IDs to allocate for user-namespaces (via
|
||||
`/etc/login.defs`). This creates a problem you won't realize until the runner
|
||||
actually picks up a job 😞 The main symptom of this issue will be messages in
|
||||
actually picks up a job. The main symptom of this issue will be messages in
|
||||
the pipglr containers log, similar to (abbreviated):
|
||||
|
||||
```text
|
||||
|
||||
Reference in New Issue
Block a user