add decorator for cli context

This commit is contained in:
2026-09-24 19:06:28 +02:00
parent b4e1fa4ec3
commit d4c78cc29d
11 changed files with 285 additions and 25 deletions
+19 -12
View File
@@ -7,7 +7,7 @@ app_name := "dbyaml"
# interactive recipe selection
[group('info')]
@select-shell:
@select:
just --choose
prelude := '''
@@ -25,13 +25,17 @@ version cmd=app_name:
{{prelude}}
{{cmd}} --version
# run all dev tools
# run checkers
[parallel, group('dev')]
ci: test format-check lint-check type-check schema-check
ci-check: test format-check lint-check type-check schema-check
# run all dev tools
# run fixes
[parallel, group('dev')]
ci-gen: format-fix lint-fix type-fix docs
ci-fix: format-fix lint-fix type-fix
# run generators (docs)
[parallel, group('dev')]
ci-gen: docs
# setup virtual environment
[group('install')]
@@ -97,9 +101,8 @@ ci-gen: format-fix lint-fix type-fix docs
echo "running checker; shellcheck (shell)"
shellcheck scripts/*.sh
# TODO:
# Spell checking
# uv run --only-group=check typos
echo "running spell-checker: typos"
uv run --only-group=check typos
# fix typing
[group('dev')]
@@ -109,25 +112,29 @@ ci-gen: format-fix lint-fix type-fix docs
echo "running checker; shellcheck (shell)"
shellcheck scripts/*.sh
# TODO: run fix
echo "running spell-checker: typos"
uv run --only-group=check typos --write-changes
# check project schema
[group('dev')]
@schema-check:
echo "running schema checker (Metadata dbyaml)"
echo "running schema checker (dbyaml config)"
uv run scripts/generate_schema.py | diff - src/dbyaml/resources/dbyaml.schema.json
# generate all docs
[group('dev')]
docs: schema-generate man
docs: schema-generate docs-man
# generate project schema
[group('dev')]
@schema-generate:
echo "Python project metadata and dbyaml schema"
echo "running schema checker (dbyaml config)"
uv run scripts/generate_schema.py --outfile src/dbyaml/resources/dbyaml.schema.json
# generate man pages
[group('dev')]
@man:
@docs-man:
echo "generate man"
uv run click-man --man-version $(uv version --short) dbyaml