mirror of
https://github.com/uklans/cache-domains
synced 2025-08-02 14:21:22 +02:00
This change adds [LeftHook](https://lefthook.dev/) as a GitHub hook management tool alongside [MegaLinter](https://megalinter.io/) to lint all relevant files within the repository. For users that don't end up installing LeftHook for pre-commit hooks, megalinter picks up the necessary formatting changes and reports them. * feat: add lefthook, megalinter and update editorconfig * fix: lint commit ordering * refactor: adjust megalinter reporters * refactor: adjust description for cache domains * refactor: single - for passing options * refactor: add repo-specific fmt in megalinter pre-commands too
20 lines
529 B
YAML
20 lines
529 B
YAML
pre-commit:
|
|
parallel: true
|
|
jobs:
|
|
- name: sort cache domains
|
|
run: jq ".cache_domains |= sort_by(.name)" {all_files} > {all_files}.tmp && mv {all_files}.tmp {all_files}
|
|
glob: "cache_domains.json"
|
|
|
|
- name: sort cdns
|
|
run: |
|
|
for f in {all_files}; do
|
|
sort -uo ${f} ${f}
|
|
done
|
|
env:
|
|
LC_ALL: C
|
|
glob: "*.txt"
|
|
|
|
- name: megalinter
|
|
run: docker run --rm -e USER=$(id -u) -e GROUP=$(id -g) -v "$PWD:/tmp/lint" oxsecurity/megalinter:v8
|
|
stage_fixed: true
|