doc: refine usage

Signed-off-by: Brian McGee <brian@bmcgee.ie>
This commit is contained in:
Brian McGee 2024-05-01 13:54:06 +01:00
parent 17f354b880
commit f1c80edcf1
Signed by: brianmcgee
GPG Key ID: D49016E76AD1E8C0

View File

@ -64,14 +64,6 @@ treefmt [FLAGS] [OPTIONS] [--] [paths]...
> Only apply selected formatters. Defaults to all formatters. > Only apply selected formatters. Defaults to all formatters.
`-H, --hidden`
> Also traverse hidden files (files that start with a .). This behaviour can be overridden with the `--no-hidden` flag.
`--no-hidden`
> Override the `--hidden` flag. Don't traverse hidden files.
`--tree-root <tree-root>` `--tree-root <tree-root>`
> Set the path to the tree root directory where treefmt will look for the files to format. Defaults to the folder holding the `treefmt.toml` file. Its mostly useful in combination with `--config-file` to specify the project root which wont coincide with the directory holding `treefmt.toml`. > Set the path to the tree root directory where treefmt will look for the files to format. Defaults to the folder holding the `treefmt.toml` file. Its mostly useful in combination with `--config-file` to specify the project root which wont coincide with the directory holding `treefmt.toml`.
@ -92,24 +84,24 @@ Typically, you would use treefmt in the CI with the `--fail-on-change` and `--no
You can you set a `treefmt` job in the GitHub pipeline for Ubuntu with nix-shell like this: You can you set a `treefmt` job in the GitHub pipeline for Ubuntu with nix-shell like this:
``` ```yaml
name: treefmt name: treefmt
on: on:
pull_request: pull_request:
push: push:
branches: main branches: main
jobs: jobs:
formatter: formatter:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v1
- uses: cachix/install-nix-action@v12 - uses: cachix/install-nix-action@v12
with: with:
nix_path: nixpkgs=channel:nixos-unstable nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v10 - uses: cachix/cachix-action@v10
with: with:
name: nix-community name: nix-community
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- name: treefmt - name: treefmt
run: nix-shell --run "treefmt --fail-on-change --no-cache" run: nix-shell --run "treefmt --fail-on-change --no-cache"
``` ```