add first structure
This commit is contained in:
@@ -0,0 +1,133 @@
|
||||
app_name := "dbyaml"
|
||||
|
||||
# list all available recipes
|
||||
[default, group('info')]
|
||||
@list:
|
||||
just --list --unsorted
|
||||
|
||||
# interactive recipe selection
|
||||
[group('info')]
|
||||
@select-shell:
|
||||
just --choose
|
||||
|
||||
prelude := '''
|
||||
#!/bin/sh
|
||||
set -euo pipefail
|
||||
if ! test ":$PATH:" = *":$(pwd)/.venv/bin:"* ; then
|
||||
export PATH="${UV_PROJECT:-$(pwd)}/.venv/bin:$PATH"
|
||||
fi
|
||||
'''
|
||||
|
||||
# installed package version
|
||||
[group('info')]
|
||||
[script]
|
||||
version cmd=app_name:
|
||||
{{prelude}}
|
||||
{{cmd}} --version
|
||||
|
||||
# run all dev tools
|
||||
[parallel, group('dev')]
|
||||
ci: test format-check lint-check type-check schema-check
|
||||
|
||||
# run all dev tools
|
||||
[parallel, group('dev')]
|
||||
ci-gen: format-fix lint-fix type-fix docs
|
||||
|
||||
# setup virtual environment
|
||||
[group('install')]
|
||||
@venv:
|
||||
[ -d .venv ] || uv venv
|
||||
|
||||
# install core environment
|
||||
[group('install')]
|
||||
@install-core: venv
|
||||
echo "install venv core"
|
||||
uv sync --no-dev
|
||||
|
||||
# install dev environment
|
||||
[group('install')]
|
||||
@install-dev: venv
|
||||
echo "install venv dev"
|
||||
uv sync
|
||||
|
||||
# run tests
|
||||
[group('dev')]
|
||||
@test:
|
||||
echo "running tests; pytest (Python)"
|
||||
uv run pytest
|
||||
|
||||
# check formatting
|
||||
[group('dev')]
|
||||
@format-check:
|
||||
echo "running formatter; ruff (Python)"
|
||||
uv run --only-group=check ruff format --diff .
|
||||
|
||||
echo "running formatter; yamlfmt (YAML)"
|
||||
uv run yamlfmt -lint -quiet -output_format default -formatter indent=2,indentless_arrays=true,retain_line_breaks_single=true,trim_trailing_whitespace=true .
|
||||
|
||||
# fix formatting
|
||||
[group('dev')]
|
||||
@format-fix:
|
||||
echo "running formatter; ruff (Python)"
|
||||
uv run --only-group=check ruff format .
|
||||
|
||||
# TODO: yaml files
|
||||
|
||||
# check linting
|
||||
[group('dev')]
|
||||
@lint-check:
|
||||
echo "running linter; ruff (Python)"
|
||||
uv run --only-group=check ruff check --diff .
|
||||
|
||||
# fix linting
|
||||
[group('dev')]
|
||||
@lint-fix:
|
||||
echo "running linter; ruff (Python)"
|
||||
uv run --only-group=check ruff check .
|
||||
|
||||
# check typing
|
||||
[group('dev')]
|
||||
@type-check:
|
||||
echo "running type-checker; ty (Python)"
|
||||
uv run --only-group=check ty check .
|
||||
|
||||
echo "running validator; validate-pyproject (Python)"
|
||||
uv run validate-pyproject pyproject.toml
|
||||
|
||||
echo "running checker; shellcheck (shell)"
|
||||
shellcheck scripts/*.sh
|
||||
|
||||
# TODO:
|
||||
# Spell checking
|
||||
# uv run --only-group=check typos
|
||||
|
||||
# fix typing
|
||||
[group('dev')]
|
||||
@type-fix:
|
||||
echo "running type-checker; ty (Python)"
|
||||
uv run --only-group=check ty check --fix .
|
||||
|
||||
echo "running checker; shellcheck (shell)"
|
||||
shellcheck scripts/*.sh
|
||||
|
||||
# check project schema
|
||||
[group('dev')]
|
||||
@schema-check:
|
||||
echo "running schema checker (Metadata dbyaml)"
|
||||
uv run scripts/generate_schema.py | diff - src/dbyaml/resources/dbyaml.schema.json
|
||||
|
||||
# generate all docs
|
||||
[group('dev')]
|
||||
docs: schema-generate man
|
||||
|
||||
# generate project schema
|
||||
[group('dev')]
|
||||
@schema-generate:
|
||||
echo "Python project metadata and dbyaml schema"
|
||||
uv run scripts/generate_schema.py --outfile src/dbyaml/resources/dbyaml.schema.json
|
||||
|
||||
# generate man pages
|
||||
[group('dev')]
|
||||
@man:
|
||||
echo "generate man"
|
||||
uv run click-man --man-version $(uv version --short) dbyaml
|
||||
Reference in New Issue
Block a user