Replies: 4 comments 3 replies
|
There's the IntelliJ formatter, but I've yet to see a standalone formatter. Probably worth an issue. |
0 replies
|
This is missing, but is something that we'd like to provide. On a similar note, we also want to provide a linter. |
0 replies
|
Can it also sort the mappings/keys? Like this: before
amends "package://github.com/jdx/hk/releases/download/v1.55.0/hk@1.55.0#/Config.pkl"
import "package://github.com/jdx/hk/releases/download/v1.55.0/hk@1.55.0#/Builtins.pkl"
local linters = new Mapping<String, Step> {
["betterleaks"] = Builtins.betterleaks
["sort-package-json"] = Builtins.sort_package_json
["yamlfix"] {
types = List("yaml")
check = "yamlfix --check {{files}}"
fix = "yamlfix {{files}}"
depends = List("prettier")
}
["yamllint"] = (Builtins.yamllint) {
depends = List("yamlfix")
}
["tombi"] = Builtins.tombi
["mise"] = Builtins.mise
["rumdl"] = Builtins.rumdl
["rumdl-format"] = Builtins.rumdl_format
["typos"] = Builtins.typos
["pkl-format"] = Builtins.pkl_format
["ls-lint"] {
check = "ls-lint ."
batch = false
}
["prettier"] = Builtins.prettier
}
hooks {
["pre-commit"] {
stash = "git"
fix = true
steps = linters
}
["commit-msg"] {
steps {
["conventional-commit"] = Builtins.cocogitto_commit_msg
["typos"] = Builtins.typos
}
}
["fix"] {
fix = true
steps = linters
}
["check"] {
steps = linters
}
}after
amends "package://github.com/jdx/hk/releases/download/v1.55.0/hk@1.55.0#/Config.pkl"
import "package://github.com/jdx/hk/releases/download/v1.55.0/hk@1.55.0#/Builtins.pkl"
local linters = new Mapping<String, Step> {
["betterleaks"] = Builtins.betterleaks
["ls-lint"] {
check = "ls-lint ."
batch = false
}
["mise"] = Builtins.mise
["pkl-format"] = Builtins.pkl_format
["prettier"] = Builtins.prettier
["rumdl"] = Builtins.rumdl
["rumdl-format"] = Builtins.rumdl_format
["sort-package-json"] = Builtins.sort_package_json
["tombi"] = Builtins.tombi
["typos"] = Builtins.typos
["yamlfix"] {
types = List("yaml")
check = "yamlfix --check {{files}}"
fix = "yamlfix {{files}}"
depends = List("prettier")
}
["yamllint"] = (Builtins.yamllint) {
depends = List("yamlfix")
}
}
hooks {
["check"] {
steps = linters
}
["commit-msg"] {
steps {
["conventional-commit"] = Builtins.cocogitto_commit_msg
["typos"] = Builtins.typos
}
}
["fix"] {
fix = true
steps = linters
}
["pre-commit"] {
fix = true
stash = "git"
steps = linters
}
}
|
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Is there any tooling for automatically formatting a pkl file to some canonical style? I'm looking for something like
dhall formatorjsonnetfmt, that I can run as a pre-commit hook to my repo.I don't care what the style is, as long as it can be applied consistently and automatically.
All reactions