Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
uses: jdx/mise-action@v3

- name: SwiftFormat Lint
run: mise exec -- swiftformat --lint . --reporter github-actions-log
run: hk check --all

apple:
if: github.event_name != 'pull_request' || !contains(github.event.pull_request.title, '[skip ci]')
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,15 @@ class MyClass: NSObject {
}
```

## Development

Install [Mise](https://mise.jdx.dev/), then install the project tools and Git hooks:

```sh
mise install
mise exec -- hk install --mise
```

## Credits

This library is inspired by and builds upon the following projects:
Expand Down
38 changes: 38 additions & 0 deletions hk.pkl
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
amends "package://github.com/jdx/hk/releases/download/v1.57.0/hk@1.57.0#/Config.pkl"

local linters = new Mapping<String, Step> {
["swiftformat"] {
glob = "**/*.swift"

check = new CommandSpec {
command = new Command {
argv = List("swiftformat", "--lint", "--reporter", "github-actions-log", "{{files}}")
}
effect = "read"
}

fix = new CommandSpec {
command = new Command {
argv = List("swiftformat", "{{files}}")
}
effect = "write"
}
}
}

hooks {
["pre-commit"] {
fix = true
stash = "git"
steps = linters
}

["check"] {
steps = linters
}

["fix"] {
fix = true
steps = linters
}
}
34 changes: 34 additions & 0 deletions mise.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions mise.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
min_version = "2026.8.6"

[tool_config]
locked = true

[tools]
hk = "1"
swiftformat = "0"
Loading