From e3cd75780d82ff176051e610593c873f1519b08a Mon Sep 17 00:00:00 2001 From: Sebastian Wendel Date: Mon, 1 Aug 2022 14:36:57 +0200 Subject: [PATCH] added pre-commit hooks --- .envrc | 17 ++++------------- .gitignore | 1 - .pre-commit-config.yaml | 27 +++++++++++++++++++++++++++ flake.nix | 16 ++++++++++------ 4 files changed, 41 insertions(+), 20 deletions(-) create mode 100644 .pre-commit-config.yaml diff --git a/.envrc b/.envrc index ff5d1e6..9a170d3 100644 --- a/.envrc +++ b/.envrc @@ -1,16 +1,7 @@ -if ! has nix_direnv_version || ! nix_direnv_version 2.1.1; then - source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.1.1/direnvrc" "sha256-b6qJ4r34rbE23yWjMqbmu3ia2z4b2wIlZUksBke/ol0=" -fi -watch_file **/*.nix -watch_file flake.lock +use flake -if (nix help flake &> /dev/null) -then - use flake +watch_file ./nix/checks.nix +watch_file ./nix/dev-shell.nix -else - use nix -fi - -eval "$shellHook" \ No newline at end of file +eval "$shellHook" diff --git a/.gitignore b/.gitignore index 98cf294..92453a8 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,6 @@ .*.swp .direnv .DS_Store -.pre-commit-config.yaml *.tgz /.idea/* .vscode/*.log diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..e518d25 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,27 @@ +--- +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.3.0 + hooks: + - id: check-added-large-files + - id: check-builtin-literals + - id: check-case-conflict + - id: check-docstring-first + - id: check-json + - id: check-merge-conflict + - id: check-yaml + - id: detect-private-key + - id: double-quote-string-fixer + - id: end-of-file-fixer + - id: trailing-whitespace + + - repo: https://github.com/crate-ci/typos + rev: v1.10.3 + hooks: + - id: typos + + - repo: https://github.com/adrienverge/yamllint + rev: v1.27.1 + hooks: + - id: yamllint + files: '.*(?