diff --git a/.github/workflows/just-lint.yml b/.github/workflows/just-lint.yml index d998550..a068ef1 100644 --- a/.github/workflows/just-lint.yml +++ b/.github/workflows/just-lint.yml @@ -15,4 +15,4 @@ jobs: - name: Install just uses: extractions/setup-just@v4 - name: Lint justfiles - run: just --justfile just.just --working-directory . fmt-check + run: just --justfile just/just.just --working-directory . just-fmt-check diff --git a/README.md b/README.md index 05574c7..b0e533a 100644 --- a/README.md +++ b/README.md @@ -92,11 +92,10 @@ Modules are moving into their own directories, each documenting itself: | `docusaurus` | Docusaurus site build, serve, deploy, formatting | [docusaurus/README.md](docusaurus/README.md) | | `go` | Go build, test, coverage gate, format, lint | [go/README.md](go/README.md) | | `md` | Repository markdown formatting (mdformat via uvx) | [md/README.md](md/README.md) | +| `just` | Justfile formatting | [just/README.md](just/README.md) | | `react` | React app build, lint, format, SDK codegen (Bun) | [react/README.md](react/README.md) | -Modules not yet moved are documented inline below. - -### just.just +## just.just | Recipe | Description | | ----------- | --------------------------------------- | diff --git a/just.mod.just b/just.mod.just deleted file mode 100644 index d3dd51c..0000000 --- a/just.mod.just +++ /dev/null @@ -1,3 +0,0 @@ -set working-directory := '../..' - -import? 'just.just' diff --git a/just/README.md b/just/README.md new file mode 100644 index 0000000..e753dba --- /dev/null +++ b/just/README.md @@ -0,0 +1,39 @@ +# just.just + +Formats and checks the justfiles in a repository, using just's own formatter. + +## 📦 Usage + +`just.just` is consumed with `import?`. Its recipes are flat and prefixed, so it +needs no `.mod.just` shim. + +```just +import? '.just/remote/just.just' + +# Fetch shared justfiles from osapi-justfiles +fetch: + mkdir -p .just/remote + curl -sSfL https://raw.githubusercontent.com/osapi-io/osapi-justfiles/refs/heads/main/just/just.just -o .just/remote/just.just +``` + +Then: + +```bash +just fetch # Download the shared recipe file +just just-fmt # Reformat every justfile in the repository +just just-fmt-check # Check formatting, non-zero exit on drift +``` + +## 🔍 What it covers + +Every `justfile` and `*.just` in the repository, except: + +| Skipped | Why | +| -------------- | -------------------------------------------------------------- | +| `**/.just/*` | fetched modules, at any depth — they belong to this repository | +| `.worktrees/*` | checkouts of other branches | +| `.claude/*` | generated and regenerated by tooling | + +## 📄 License + +The [MIT](../LICENSE) License. diff --git a/just.just b/just/just.just similarity index 98% rename from just.just rename to just/just.just index b72ad87..69d4cda 100644 --- a/just.just +++ b/just/just.just @@ -18,7 +18,7 @@ # Reformat justfiles with canonical style [group('fmt')] -fmt: +just-fmt: #!/usr/bin/env bash set -euo pipefail find . -type f \( -name '*.just' -o -name 'justfile' \) ! -path './.worktrees/*' ! -path './.claude/*' ! -path '*/.just/*' | while read -r f; do @@ -27,7 +27,7 @@ fmt: # Check justfile formatting [group('fmt')] -fmt-check: +just-fmt-check: #!/usr/bin/env bash set -euo pipefail failed=0 diff --git a/justfile b/justfile index 4d6321d..ae3f109 100644 --- a/justfile +++ b/justfile @@ -2,8 +2,8 @@ # Check justfile formatting test: - just --justfile just.just --working-directory . fmt-check + just --justfile just/just.just --working-directory . just-fmt-check # Format and lint before committing ready: - just --justfile just.just --working-directory . fmt + just --justfile just/just.just --working-directory . just-fmt