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
7 changes: 7 additions & 0 deletions .config/ls-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
ls:
.*: kebab-case

ignore:
- README.md
- scripts/xcode/tests/test_xcode-utils.bash
6 changes: 6 additions & 0 deletions .config/lychee.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
cache = true
exclude = [
# StackExchange and StackOverflow URLs keep throwing 403s for some reason
'^https?://(.*\.)?stackexchange\.com',
'^https?://(.*\.)?stackoverflow\.com',
]
33 changes: 33 additions & 0 deletions .config/ryl.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[files]
yaml = [
"*.yaml",
"*.yml",
".yamllint",
]

[rules]
anchors = "enable"
braces = "enable"
brackets = "enable"
colons = "enable"
commas = "enable"
document-end = "disable"
empty-lines = "enable"
empty-values = "disable"
float-values = "disable"
hyphens = "enable"
indentation = "enable"
key-duplicates = "enable"
key-ordering = "disable"
line-length = "enable"
new-line-at-end-of-file = "enable"
new-lines = "enable"
octal-values = "disable"
quoted-strings = "disable"
trailing-spaces = "enable"

[rules.comments]
min-spaces-from-content = 1

[per-file-ignores]
".github/workflows/*" = ["truthy"]
File renamed without changes.
3 changes: 2 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
# Documentation for this file: https://docs.github.com/en/code-security/reference/supply-chain-security/dependabot-options-reference
# Documentation for this file:
# https://docs.github.com/en/code-security/reference/supply-chain-security/dependabot-options-reference
version: 2

updates:
Expand Down
7 changes: 3 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# General
# general
.DS_Store
.env

# Cached files
# caches
.cache/

# Packer
.lycheecache
packer_cache/
72 changes: 45 additions & 27 deletions hk.pkl
Original file line number Diff line number Diff line change
@@ -1,52 +1,70 @@
amends "package://github.com/jdx/hk/releases/download/v2.1.0/hk@2.1.0#/Config.pkl"
amends "package://github.com/jdx/hk/releases/download/v2.2.0/hk@2.2.0#/Config.pkl"

import "package://github.com/jdx/hk/releases/download/v2.1.0/hk@2.1.0#/Builtins.pkl"
import "package://github.com/jdx/hk/releases/download/v2.2.0/hk@2.2.0#/Builtins.pkl"

fail_fast = false
env {
["HK_MISE"] = "true"
["HK_MISE"] = "1"
}

local builtin_linters = new Mapping<String, Step> {
steps {
["packer"] = new Step {
glob = "*.pkr.hcl"
check = "packer fmt -check {{ files }}"
fix = "packer fmt {{ files }}"
}

// Builtins
["actionlint"] = Builtins.actionlint
["editorconfig-checker"] = Builtins.editorconfig_checker
["mise"] = Builtins.mise
["pkl"] = Builtins.pkl
["pkl-format"] = Builtins.pkl_format
["shellcheck"] = Builtins.shellcheck
["ryl"] = Builtins.ryl
["shfmt"] = Builtins.shfmt
["tombi"] = Builtins.tombi
}

local utility_linters = new Mapping<String, Step> {
["ls-lint"] = (Builtins.ls_lint) {
check {
command {
argv = Builtins.ls_lint.check.command.argv + List("-config", ".config/ls-lint.yml")
}
}
}
["lychee"] = (Builtins.lychee) {
exclude = "mise.lock"
check {
command {
argv = Builtins.lychee.check.command.argv + List("--config", ".config/lychee.toml")
}
}
}
["shellcheck"] = (Builtins.shellcheck) {
check {
command {
argv = Builtins.shellcheck.check.command.argv + List("--rcfile", ".config/shellcheckrc")
}
}
check_diff {
command {
argv =
Builtins.shellcheck.check_diff.command.argv + List("--rcfile", ".config/shellcheckrc")
}
}
}

// Utilities
["byte-order-marker"] = Builtins.byte_order_marker
["check-added-large-files"] = Builtins.check_added_large_files
["check-case-conflict"] = Builtins.check_case_conflict
["check-executables-have-shebangs"] = Builtins.check_executables_have_shebangs
["check-merge-conflict"] = Builtins.check_merge_conflict
["check-symlinks"] = Builtins.check_symlinks
["destroyed_symlinks"] = Builtins.destroyed_symlinks
["detect-private-key"] = Builtins.detect_private_key
["fix-smart-quotes"] = Builtins.fix_smart_quotes
["forbid-submodules"] = Builtins.forbid_submodules
["mixed-line-ending"] = Builtins.mixed_line_ending
["newlines"] = Builtins.newlines
["trailing-whitespace"] = Builtins.trailing_whitespace
}

local all_linters = new Mapping<String, Step> {
...builtin_linters
...utility_linters
}

hooks {
["pre-commit"] {
fix = true
stash = "git"
steps = all_linters
}
["fix"] {
fix = true
steps = all_linters
}
["check"] {
steps = all_linters
}
}
Loading