mirror of
https://gitea.com/mcereda/oam.git
synced 2026-02-09 05:44:23 +00:00
chore: improve repo management
This commit is contained in:
@@ -26,3 +26,6 @@ indent_size = 4
|
||||
|
||||
[*.py]
|
||||
indent_size = 4
|
||||
|
||||
[*.ts]
|
||||
indent_size = 4
|
||||
|
||||
@@ -13,15 +13,28 @@ debug:
|
||||
glob: '.commitlintrc.js'
|
||||
run: commitlint --print-config
|
||||
|
||||
pre-flight:
|
||||
parallel: true
|
||||
commands:
|
||||
commitlint:
|
||||
run: npm install --save-dev '@commitlint/cli' '@commitlint/config-conventional'
|
||||
venv:
|
||||
run: make recreate-venv
|
||||
|
||||
|
||||
lint:
|
||||
parallel: true
|
||||
commands:
|
||||
ansible: &ansible-lint
|
||||
run: .venv/bin/ansible-lint
|
||||
docker: &hadolint
|
||||
# The official docker image is based on scratch and only takes only one
|
||||
# input file at a time. I have no clue how to fix that for now so let's
|
||||
# just use the local command.
|
||||
glob: "*Dockerfile*"
|
||||
run: hadolint {all_files}
|
||||
# ini: &pyinilint # FIXME
|
||||
# run: pyinilint 'file'
|
||||
md: &markdownlint
|
||||
glob: "*.md"
|
||||
run: >- # '{all_files}' and {files} only include ones managed by git for some reason
|
||||
@@ -36,6 +49,9 @@ lint:
|
||||
validate:
|
||||
parallel: true
|
||||
commands:
|
||||
ansible-playbook: &ansible-playbook-syntax-check
|
||||
glob: "*ansible*/play*.{yaml,yml}"
|
||||
run: .venv/bin/ansible-playbook -i localhost, --syntax-check {all_files}
|
||||
json: &jq
|
||||
# No official docker image available for now, falling back to the local
|
||||
# command.
|
||||
@@ -62,6 +78,10 @@ pre-commit:
|
||||
run: >-
|
||||
yq '.' {staged_files} > /dev/null
|
||||
&& echo 'All YAML files are readable'
|
||||
validate-ansible-playbooks:
|
||||
<<: *ansible-playbook-syntax-check
|
||||
lint-ansible:
|
||||
<<: *ansible-lint
|
||||
lint-docker:
|
||||
<<: *hadolint
|
||||
run: hadolint {staged_files}
|
||||
@@ -78,7 +98,7 @@ pre-commit:
|
||||
|
||||
commit-msg:
|
||||
commands:
|
||||
commitlint:
|
||||
lint: &commitlint
|
||||
# No official docker image available for now, falling back to the local
|
||||
# command.
|
||||
run: commitlint --edit
|
||||
|
||||
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@@ -90,6 +90,7 @@
|
||||
"clamav",
|
||||
"clamd",
|
||||
"clamscan",
|
||||
"cloudinit",
|
||||
"commitlint",
|
||||
"compsize",
|
||||
"configmap",
|
||||
@@ -238,9 +239,11 @@
|
||||
"turris",
|
||||
"twrp",
|
||||
"uncordon",
|
||||
"userdata",
|
||||
"userland",
|
||||
"usermod",
|
||||
"userspace",
|
||||
"venv",
|
||||
"winget",
|
||||
"wlan",
|
||||
"xattr",
|
||||
|
||||
17
Makefile
17
Makefile
@@ -1,7 +1,12 @@
|
||||
create-venv: override python_version ?= 3.12
|
||||
create-venv:
|
||||
python${python_version} -m 'venv' '.venv'
|
||||
source '.venv/bin/activate' && pip install -r 'requirements.txt'
|
||||
#!make
|
||||
|
||||
setup-for-hooks:
|
||||
npm install --save-dev '@commitlint/cli' '@commitlint/config-conventional'
|
||||
override venv ?= ${shell git rev-parse --show-toplevel}/.venv
|
||||
|
||||
create-venv: override python_version ?= 3.12
|
||||
create-venv: ${shell which 'python${python_version}'}
|
||||
@python${python_version} -m 'venv' '${venv}'
|
||||
@source '${venv}/bin/activate' && pip --require-virtualenv install -r 'requirements.txt'
|
||||
|
||||
recreate-venv:
|
||||
@rm -r '${venv}'
|
||||
@${MAKE} create-venv
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
ansible==9.3.0
|
||||
ansible==9.4.0
|
||||
click==8.1.7
|
||||
pyinilint==0.17
|
||||
|
||||
Reference in New Issue
Block a user