Skip to content

Commit

Permalink
Switch to mise
Browse files Browse the repository at this point in the history
  • Loading branch information
autarch committed Nov 30, 2024
1 parent 8c7fcc6 commit c83949c
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 59 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ jobs:
run: |
git config --global user.email "[email protected]"
git config --global user.name "J. Doe"
- name: Run install-dev-tools.sh
- name: Install mise
run: |
set -e
mkdir $HOME/bin
./dev/bin/install-dev-tools.sh
set -x
curl https://mise.run | sh
mise install
- name: Run precious
run: |
PATH=$PATH:$HOME/bin precious lint -a
mise exec -- precious lint -a
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,3 +186,29 @@ That's debatable. The big advantage of using `ubi` is that you can use the exact
macOS, and Windows. The big disadvantage is that you don't get a full package that contains metadata
(like a license file) or extras like shell completion files, nor can you easily uninstall it using a
package manager.

## Linting and Tidying this Code

The code in this repo is linted and tidied with
[`precious`](https://github.com/houseabsolute/precious). This repo contains a `mise.toml` file.
[Mise](https://mise.jdx.dev/) is a tool for managing dev tools with per-repo configuration. You can
install `mise` and use it to run `precious` as follows:

```
# Installs mise
curl https://mise.run | sh
# Installs precious and other dev tools
mise install
```

Once this is done, you can run `precious` via `mise`:

```
# Lints all code
mise exec -- precious lint -a
# Tidies all code
mise exec -- precious tidy -a
```

If you want to use `mise` for other projects, see [its documentation](https://mise.jdx.dev/) for
more details on how you can configure your shell to always activate `mise`.
47 changes: 0 additions & 47 deletions dev/bin/install-dev-tools.sh

This file was deleted.

9 changes: 9 additions & 0 deletions mise.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[tools]
node = "22.11.0"
"npm:prettier" = "3.4.1"
shellcheck = "v0.10.0"
shfmt = "v3.10.0"
taplo = "0.9.3"
typos = "1.28.1"
"ubi:houseabsolute/omegasort" = "v0.1.3"
"ubi:houseabsolute/precious" = "v0.7.3"
9 changes: 1 addition & 8 deletions precious.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,7 @@ labels = ["default", "fast-tidy"]
[commands.prettier]
type = "both"
include = ["**/*.md", "**/*.yml"]
cmd = [
"./node_modules/.bin/prettier",
"--no-config",
"--prose-wrap",
"always",
"--print-width",
"100",
]
cmd = ["prettier", "--no-config", "--prose-wrap", "always", "--print-width", "100"]
lint_flags = "--check"
tidy_flags = "--write"
ok_exit_codes = 0
Expand Down

0 comments on commit c83949c

Please sign in to comment.