From 06eb89bb5c1299634d0bf8f07dc829c405293ab9 Mon Sep 17 00:00:00 2001 From: Stephen Rosen Date: Thu, 26 Feb 2026 18:39:43 -0600 Subject: [PATCH] Switch from 'make' to 'just' --- .github/workflows/cron.yaml | 4 +-- .pre-commit-hooks.yaml | 50 ++++++++++++++++---------------- CONTRIBUTING.md | 4 +-- Makefile | 26 ----------------- RELEASING.md | 2 +- justfile | 26 +++++++++++++++++ scripts/generate-hooks-config.py | 2 +- 7 files changed, 57 insertions(+), 57 deletions(-) delete mode 100644 Makefile create mode 100644 justfile diff --git a/.github/workflows/cron.yaml b/.github/workflows/cron.yaml index 8ce65234b..23c32fa47 100644 --- a/.github/workflows/cron.yaml +++ b/.github/workflows/cron.yaml @@ -16,10 +16,10 @@ jobs: python-version: '3.x' - name: install tox - run: python -m pip install 'tox' + run: python -m pip install 'tox' 'rust-just' - name: vendor-schemas - run: make vendor-schemas + run: just vendor-schemas # this action seems to have significant usage, so it should be stable # can always re-implement with `git status --porcelain`, etc. if necessary diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index 898fb4a6c..969c076e2 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -20,7 +20,7 @@ # this hook is autogenerated from a script # to modify this hook, update `src/check_jsonschema/catalog.py` -# and run `make generate-hooks` or `tox run -e generate-hooks-config` +# and run `just generate-hooks` or `tox run -e generate-hooks-config` - id: check-azure-pipelines name: Validate Azure Pipelines description: 'Validate Azure Pipelines config against the schema provided by Microsoft' @@ -31,7 +31,7 @@ # this hook is autogenerated from a script # to modify this hook, update `src/check_jsonschema/catalog.py` -# and run `make generate-hooks` or `tox run -e generate-hooks-config` +# and run `just generate-hooks` or `tox run -e generate-hooks-config` - id: check-bamboo-spec name: Validate Bamboo Specs description: 'Validate Bamboo Specs against the schema provided by SchemaStore' @@ -42,7 +42,7 @@ # this hook is autogenerated from a script # to modify this hook, update `src/check_jsonschema/catalog.py` -# and run `make generate-hooks` or `tox run -e generate-hooks-config` +# and run `just generate-hooks` or `tox run -e generate-hooks-config` - id: check-bitbucket-pipelines name: Validate Bitbucket Pipelines description: 'Validate Bitbucket Pipelines against the schema provided by SchemaStore' @@ -53,7 +53,7 @@ # this hook is autogenerated from a script # to modify this hook, update `src/check_jsonschema/catalog.py` -# and run `make generate-hooks` or `tox run -e generate-hooks-config` +# and run `just generate-hooks` or `tox run -e generate-hooks-config` - id: check-buildkite name: Validate Buildkite Pipelines description: 'Validate Buildkite Pipelines against the schema provided by Buildkite' @@ -70,7 +70,7 @@ # this hook is autogenerated from a script # to modify this hook, update `src/check_jsonschema/catalog.py` -# and run `make generate-hooks` or `tox run -e generate-hooks-config` +# and run `just generate-hooks` or `tox run -e generate-hooks-config` - id: check-circle-ci name: Validate CircleCI config description: 'Validate CircleCI config against the schema provided by SchemaStore' @@ -80,7 +80,7 @@ # this hook is autogenerated from a script # to modify this hook, update `src/check_jsonschema/catalog.py` -# and run `make generate-hooks` or `tox run -e generate-hooks-config` +# and run `just generate-hooks` or `tox run -e generate-hooks-config` - id: check-citation-file-format name: Validate Citation File Format description: 'Validate Citation File Format' @@ -90,7 +90,7 @@ # this hook is autogenerated from a script # to modify this hook, update `src/check_jsonschema/catalog.py` -# and run `make generate-hooks` or `tox run -e generate-hooks-config` +# and run `just generate-hooks` or `tox run -e generate-hooks-config` - id: check-cloudbuild name: Validate Google Cloud Build config description: 'Validate Google Cloud Build config against the schema provided by SchemaStore' @@ -101,7 +101,7 @@ # this hook is autogenerated from a script # to modify this hook, update `src/check_jsonschema/catalog.py` -# and run `make generate-hooks` or `tox run -e generate-hooks-config` +# and run `just generate-hooks` or `tox run -e generate-hooks-config` - id: check-codecov name: Validate Codecov config description: 'Validate Codecov config against the schema provided by SchemaStore' @@ -115,7 +115,7 @@ # this hook is autogenerated from a script # to modify this hook, update `src/check_jsonschema/catalog.py` -# and run `make generate-hooks` or `tox run -e generate-hooks-config` +# and run `just generate-hooks` or `tox run -e generate-hooks-config` - id: check-compose-spec name: Validate Docker Compose files description: 'Validate Docker Compose files against the schema provided by SchemaStore' @@ -130,7 +130,7 @@ # this hook is autogenerated from a script # to modify this hook, update `src/check_jsonschema/catalog.py` -# and run `make generate-hooks` or `tox run -e generate-hooks-config` +# and run `just generate-hooks` or `tox run -e generate-hooks-config` - id: check-dependabot name: Validate Dependabot Config (v2) description: 'Validate Dependabot Config (v2) against the schema provided by SchemaStore' @@ -141,7 +141,7 @@ # this hook is autogenerated from a script # to modify this hook, update `src/check_jsonschema/catalog.py` -# and run `make generate-hooks` or `tox run -e generate-hooks-config` +# and run `just generate-hooks` or `tox run -e generate-hooks-config` - id: check-drone-ci name: Validate Drone-CI Config description: 'Validate Drone-CI Config against the schema provided by SchemaStore' @@ -152,7 +152,7 @@ # this hook is autogenerated from a script # to modify this hook, update `src/check_jsonschema/catalog.py` -# and run `make generate-hooks` or `tox run -e generate-hooks-config` +# and run `just generate-hooks` or `tox run -e generate-hooks-config` - id: check-github-actions name: Validate GitHub Actions description: 'Validate GitHub Actions against the schema provided by SchemaStore' @@ -167,7 +167,7 @@ # this hook is autogenerated from a script # to modify this hook, update `src/check_jsonschema/catalog.py` -# and run `make generate-hooks` or `tox run -e generate-hooks-config` +# and run `just generate-hooks` or `tox run -e generate-hooks-config` - id: check-github-discussion name: Validate GitHub discussion description: 'Validate GitHub discussion against the schema provided by SchemaStore' @@ -181,7 +181,7 @@ # this hook is autogenerated from a script # to modify this hook, update `src/check_jsonschema/catalog.py` -# and run `make generate-hooks` or `tox run -e generate-hooks-config` +# and run `just generate-hooks` or `tox run -e generate-hooks-config` - id: check-github-issue-config name: Validate GitHub issue config description: 'Validate GitHub issue config against the schema provided by SchemaStore' @@ -195,7 +195,7 @@ # this hook is autogenerated from a script # to modify this hook, update `src/check_jsonschema/catalog.py` -# and run `make generate-hooks` or `tox run -e generate-hooks-config` +# and run `just generate-hooks` or `tox run -e generate-hooks-config` - id: check-github-issue-forms name: Validate GitHub issue forms description: 'Validate GitHub issue forms against the schema provided by SchemaStore' @@ -209,7 +209,7 @@ # this hook is autogenerated from a script # to modify this hook, update `src/check_jsonschema/catalog.py` -# and run `make generate-hooks` or `tox run -e generate-hooks-config` +# and run `just generate-hooks` or `tox run -e generate-hooks-config` - id: check-github-workflows name: Validate GitHub Workflows description: 'Validate GitHub Workflows against the schema provided by SchemaStore' @@ -220,7 +220,7 @@ # this hook is autogenerated from a script # to modify this hook, update `src/check_jsonschema/catalog.py` -# and run `make generate-hooks` or `tox run -e generate-hooks-config` +# and run `just generate-hooks` or `tox run -e generate-hooks-config` - id: check-gitlab-ci name: Validate GitLab CI config description: 'Validate GitLab CI config against the schema provided by SchemaStore' @@ -231,7 +231,7 @@ # this hook is autogenerated from a script # to modify this hook, update `src/check_jsonschema/catalog.py` -# and run `make generate-hooks` or `tox run -e generate-hooks-config` +# and run `just generate-hooks` or `tox run -e generate-hooks-config` - id: check-meltano name: Validate Meltano Config description: 'Validate Meltano config against the schema provided by Meltano' @@ -247,7 +247,7 @@ # this hook is autogenerated from a script # to modify this hook, update `src/check_jsonschema/catalog.py` -# and run `make generate-hooks` or `tox run -e generate-hooks-config` +# and run `just generate-hooks` or `tox run -e generate-hooks-config` - id: check-mergify name: Validate Mergify config description: 'Validate Mergify config against the schema provided by SchemaStore' @@ -263,7 +263,7 @@ # this hook is autogenerated from a script # to modify this hook, update `src/check_jsonschema/catalog.py` -# and run `make generate-hooks` or `tox run -e generate-hooks-config` +# and run `just generate-hooks` or `tox run -e generate-hooks-config` - id: check-readthedocs name: Validate ReadTheDocs Config description: 'Validate ReadTheDocs config against the schema provided by ReadTheDocs' @@ -274,7 +274,7 @@ # this hook is autogenerated from a script # to modify this hook, update `src/check_jsonschema/catalog.py` -# and run `make generate-hooks` or `tox run -e generate-hooks-config` +# and run `just generate-hooks` or `tox run -e generate-hooks-config` - id: check-renovate name: Validate Renovate Config description: 'Validate Renovate config against the schema provided by Renovate (does not support renovate config in package.json)' @@ -290,7 +290,7 @@ # this hook is autogenerated from a script # to modify this hook, update `src/check_jsonschema/catalog.py` -# and run `make generate-hooks` or `tox run -e generate-hooks-config` +# and run `just generate-hooks` or `tox run -e generate-hooks-config` - id: check-snapcraft name: Validate snapcraft files description: 'Validate snapcraft files against the schema provided by Canonical' @@ -301,7 +301,7 @@ # this hook is autogenerated from a script # to modify this hook, update `src/check_jsonschema/catalog.py` -# and run `make generate-hooks` or `tox run -e generate-hooks-config` +# and run `just generate-hooks` or `tox run -e generate-hooks-config` - id: check-taskfile name: Validate Taskfile Config description: 'Validate Taskfile config against the schema provided by Task' @@ -318,7 +318,7 @@ # this hook is autogenerated from a script # to modify this hook, update `src/check_jsonschema/catalog.py` -# and run `make generate-hooks` or `tox run -e generate-hooks-config` +# and run `just generate-hooks` or `tox run -e generate-hooks-config` - id: check-travis name: Validate Travis Config description: 'Validate Travis Config against the schema provided by SchemaStore' @@ -329,7 +329,7 @@ # this hook is autogenerated from a script # to modify this hook, update `src/check_jsonschema/catalog.py` -# and run `make generate-hooks` or `tox run -e generate-hooks-config` +# and run `just generate-hooks` or `tox run -e generate-hooks-config` - id: check-woodpecker-ci name: Validate Woodpecker Config description: 'Validate Woodpecker Config against the schema provided by SchemaStore' diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 91a3a7f30..ce3c48785 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -44,12 +44,12 @@ These files are automatically picked up by the testsuite and checked. Hooks are defined in `src/check_jsonschema/catalog.py`, and rendered to `.pre-commit-hooks.yaml` with the generator script. It can be run with - make generate-hooks + just generate-hooks Schemas are pulled down based on this same config. If you want to update the vendored schema copies, run - make vendor-schemas + just vendor-schemas ## Documentation diff --git a/Makefile b/Makefile deleted file mode 100644 index 3cfe026fd..000000000 --- a/Makefile +++ /dev/null @@ -1,26 +0,0 @@ -PKG_VERSION=$(shell grep '^version' pyproject.toml | head -n1 | cut -d '"' -f2) - -.PHONY: lint test vendor-schemas generate-hooks release showvars -lint: - pre-commit run -a - tox run -e mypy -test: - tox run -vendor-schemas: - tox run -e vendor-schemas -generate-hooks: - tox run -e generate-hooks-config -showvars: - @echo "PKG_VERSION=$(PKG_VERSION)" -release: - git tag -s "$(PKG_VERSION)" -m "v$(PKG_VERSION)" - -git push $(shell git rev-parse --abbrev-ref @{push} | cut -d '/' -f1) refs/tags/$(PKG_VERSION) - -.PHONY: collated-test-report -collated-test-report: - tox p - python ./scripts/aggregate-pytest-reports.py .tox/*/pytest.xml - -.PHONY: clean -clean: - rm -rf dist build *.egg-info .tox .coverage.* diff --git a/RELEASING.md b/RELEASING.md index e03c89fab..225d87c61 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -2,5 +2,5 @@ - Bump the version with `./scripts/bump-version.py NEW_VERSION` - Add, commit with `git commit -m 'Bump version for release'`, and push -- Create a release tag, which will auto-publish to testpypi (`make release`) +- Create a release tag, which will auto-publish to testpypi (`just tag-release`) - Create a GitHub release, which will auto-publish to pypi (web UI) diff --git a/justfile b/justfile new file mode 100644 index 000000000..fc5f490cb --- /dev/null +++ b/justfile @@ -0,0 +1,26 @@ +version := `uvx mddj read version` +push_remote := `git rev-parse --abbrev-ref @{push} | cut -d '/' -f1` + +lint: + pre-commit run -a + tox run -e mypy + +test: + tox p + +vendor-schemas: + tox run -e vendor-schemas + +generate-hooks: + tox run -e generate-hooks-config + +tag-release: + git tag -s "{{version}}" -m "v{{version}}" + git push {{push_remote}} refs/tags/{{version}} + +collated-test-report: test + python ./scripts/aggregate-pytest-reports.py .tox/*/pytest.xml + +clean: + rm -rf dist build *.egg-info .tox .coverage.* + find . -type d -name '__pycache__' -exec rm -r {} + diff --git a/scripts/generate-hooks-config.py b/scripts/generate-hooks-config.py index b63ee651e..2b05bb44d 100644 --- a/scripts/generate-hooks-config.py +++ b/scripts/generate-hooks-config.py @@ -44,7 +44,7 @@ def update_hook_config(new_config: str) -> None: def generate_hook_lines(config) -> t.Iterator[str]: yield "# this hook is autogenerated from a script" yield "# to modify this hook, update `src/check_jsonschema/catalog.py`" - yield "# and run `make generate-hooks` or `tox run -e generate-hooks-config`" + yield "# and run `just generate-hooks` or `tox run -e generate-hooks-config`" yield f"- id: {config['id']}" yield f" name: {config['name']}" yield f" description: '{config['description']}'"