diff --git a/.github/lint/.yamllint.yaml b/.github/lint/.yamllint.yaml new file mode 100644 index 0000000..8864275 --- /dev/null +++ b/.github/lint/.yamllint.yaml @@ -0,0 +1,26 @@ +--- +ignore: | + .direnv/ + .private/ + .vscode/ + +extends: default + +rules: + truthy: + allowed-values: ["true", "false", "on"] + + comments: + min-spaces-from-content: 1 + + line-length: disable + + braces: + min-spaces-inside: 0 + max-spaces-inside: 1 + + brackets: + min-spaces-inside: 0 + max-spaces-inside: 0 + + indentation: enable diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..204d9a9 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,33 @@ +--- +fail_fast: false + +repos: + - repo: https://github.com/kamadorueda/alejandra + rev: 3.0.0 + hooks: + - id: alejandra-system + + - repo: https://github.com/adrienverge/yamllint + rev: v1.32.0 + hooks: + - args: + - --config-file + - .github/lint/.yamllint.yaml + id: yamllint + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.4.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: fix-byte-order-marker + - id: mixed-line-ending + - id: check-added-large-files + args: [--maxkb=2048] + - id: check-merge-conflict + - id: check-executables-have-shebangs + - repo: https://github.com/Lucas-C/pre-commit-hooks + rev: v1.5.4 + hooks: + - id: remove-crlf + - id: remove-tabs + exclude: (Makefile) diff --git a/.taskfiles/nix/Taskfile.yaml b/.taskfiles/nix/Taskfile.yaml index 46f41c8..e29a04e 100644 --- a/.taskfiles/nix/Taskfile.yaml +++ b/.taskfiles/nix/Taskfile.yaml @@ -39,7 +39,7 @@ tasks: msg: "nixos-rebuild not found" - sh: which nvd msg: "nvd not found" - + .prompt_to_continue: internal: true - prompt: Do you want to continue applying this configuration? \ No newline at end of file + prompt: Do you want to continue applying this configuration? diff --git a/.taskfiles/pre-commit/Taskfile.yaml b/.taskfiles/pre-commit/Taskfile.yaml new file mode 100644 index 0000000..1a86675 --- /dev/null +++ b/.taskfiles/pre-commit/Taskfile.yaml @@ -0,0 +1,22 @@ +--- +version: "3" + +vars: + host: $HOSTNAME + +tasks: + + init: + desc: Initialize pre-commit hooks + cmds: + - pre-commit install --install-hooks + + update: + desc: Update pre-commit dependencies + cmds: + - pre-commit autoupdate + + run: + desc: Run pre-commit + cmds: + - pre-commit run --all-files diff --git a/Taskfile.yaml b/Taskfile.yaml index 5efa983..01ef6e7 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -2,15 +2,18 @@ version: "3" includes: - sops: + sop: taskfile: ".taskfiles/sops" dir: .taskfiles/sops nix: taskfile: ".taskfiles/nix" dir: "{{.ROOT_DIR}}" + pre: + taskfile: ".taskfiles/pre-commit" + dir: "{{.ROOT_DOR}}" tasks: default: silent: true cmds: - - task -l \ No newline at end of file + - task -l