mirror of
https://gitlab.fabcity.hamburg/software/fab-city-software-kit.git
synced 2024-09-20 04:18:51 +02:00
added pre-commit hooks
This commit is contained in:
parent
eb9fe1b939
commit
e3cd75780d
17
.envrc
17
.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
|
use flake
|
||||||
watch_file flake.lock
|
|
||||||
|
|
||||||
if (nix help flake &> /dev/null)
|
watch_file ./nix/checks.nix
|
||||||
then
|
watch_file ./nix/dev-shell.nix
|
||||||
use flake
|
|
||||||
|
|
||||||
else
|
eval "$shellHook"
|
||||||
use nix
|
|
||||||
fi
|
|
||||||
|
|
||||||
eval "$shellHook"
|
|
||||||
|
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -2,7 +2,6 @@
|
||||||
.*.swp
|
.*.swp
|
||||||
.direnv
|
.direnv
|
||||||
.DS_Store
|
.DS_Store
|
||||||
.pre-commit-config.yaml
|
|
||||||
*.tgz
|
*.tgz
|
||||||
/.idea/*
|
/.idea/*
|
||||||
.vscode/*.log
|
.vscode/*.log
|
||||||
|
|
27
.pre-commit-config.yaml
Normal file
27
.pre-commit-config.yaml
Normal file
|
@ -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: '.*(?<!\.yaml)$'
|
16
flake.nix
16
flake.nix
|
@ -9,10 +9,14 @@
|
||||||
flake-utils.url = "github:numtide/flake-utils";
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
};
|
};
|
||||||
outputs = { self, nixpkgs, flake-utils, ... }@inputs:
|
outputs = { self, nixpkgs, flake-utils, ... }@inputs:
|
||||||
flake-utils.lib.eachDefaultSystem (system:
|
flake-utils.lib.eachSystem [ "x86_64-linux" ] (system:
|
||||||
let pkgs = nixpkgs.legacyPackages.${system}; in
|
let
|
||||||
{
|
pkgs = import nixpkgs {
|
||||||
devShells.default = import ./shell.nix { inherit pkgs; };
|
inherit system;
|
||||||
}
|
config = {
|
||||||
);
|
allowUnfree = true;
|
||||||
|
allowBroken = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in { devShells.default = import ./shell.nix { inherit pkgs; }; });
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue