Repository navigation
Share one treefmt-nix configuration across every repository #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
38a4dcc
675a7af
285d730
03d8b41
5b8c1fa
d6cd419
b992ab2
32ddd4b
d0a71b2
77eed0a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,3 +3,5 @@ | |
| node_modules/ | ||
| __pycache__/ | ||
| .DS_Store | ||
| result | ||
| result-* | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| # Optional task runner. The locked Nix flake supplies formatter packages. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| #!/usr/bin/env sh | ||
| #MISE description="Format this repository" | ||
| set -eu | ||
| exec nix fmt |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| #!/usr/bin/env sh | ||
| #MISE description="Check formatting in a disposable Nix build" | ||
| set -eu | ||
| exec nix flake check |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| #!/usr/bin/env sh | ||
| #MISE description="Check Nix configuration, formatting and real formatter routing" | ||
| set -eu | ||
| exec nix flake check |
Large diffs are not rendered by default.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| # Evaluate treefmt-nix in formatter | ||
|
|
||
| Status: Proposed experiment | ||
|
|
||
| Date: 2026-11-09 | ||
|
|
||
| ## Context | ||
|
|
||
| This repository was created to explore shared treefmt configuration for Caido. The requested PR evaluates using treefmt-nix to supply the formatter binaries, their settings and the treefmt configuration together. | ||
|
|
||
| [STD-018](https://github.com/caido/engineering/blob/main/standards/STD-018-tooling.md) requires mise for tool setup and explicitly describes treefmt as an experiment outside the approved tool list. This proposal requests a scoped exception for this experimental repository. It does not claim that an organization-wide exception has already been approved. | ||
|
|
||
| ## Proposed decision | ||
|
|
||
| Use a locked Nix flake and treefmt-nix in `caido/formatter` to evaluate reproducible formatter packages and generated configuration. Retain mise as an optional task entry point using the layout in [STD-019](https://github.com/caido/engineering/blob/main/standards/STD-019-mise.md). | ||
|
|
||
| Keep this experiment confined to the shared formatter repository. Do not change the approved tooling standard or migrate consuming repositories as part of this PR. Maintainer acceptance of this proposal and its scoped exception is required before adopting it beyond the experiment. | ||
|
|
||
| ## Consequences | ||
|
|
||
| - Formatter commands and settings resolve to immutable Nix store paths. | ||
| - Nix or Lix is required to run a formatter profile, and the first invocation may download or build its dependencies. | ||
| - Formatter versions come from the locked Nixpkgs revision; existing per-project mise version differences are consolidated and documented in the README. | ||
| - The experiment supports Apple Silicon macOS and ARM64/x86_64 Linux. The locked Nixpkgs revision does not support Intel macOS. | ||
| - The historical audit remains available. Existing projects keep their current tooling until a separate migration is reviewed. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,14 +11,11 @@ permissions: | |
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 10 | ||
| timeout-minutes: 30 | ||
| steps: | ||
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | ||
| - uses: caido/action-mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3.2.0 | ||
| - uses: cachix/install-nix-action@75c75c31ebece974e48ebc36b4ad125bd97bd97b # v31 | ||
| with: | ||
| version: "2026.10.6" | ||
| install: false | ||
| - name: Validate configs and file routing | ||
| run: | | ||
| mise exec treefmt@2.6.0 python@3.12.14 -- treefmt --version | ||
| mise exec treefmt@2.6.0 python@3.12.14 -- python3 -m unittest discover -s tests -v | ||
| github_access_token: ${{ secrets.GITHUB_TOKEN }} | ||
| - name: Validate configuration, formatting and real formatter routing | ||
| run: nix flake check --show-trace | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Give formatting its own CI job.
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.