treewide: Format with shellcheck, jsonlint and yamllint
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
let
|
||||
sources = import ./default.nix;
|
||||
pkgs = import sources.nixpkgs { };
|
||||
pre-commit = import sources.git-hooks;
|
||||
|
||||
globalExcludes = [
|
||||
"nix/default.nix"
|
||||
".*vendor"
|
||||
".*chart/.*"
|
||||
".*schema.json"
|
||||
];
|
||||
|
||||
in
|
||||
pre-commit.run {
|
||||
src = pkgs.nix-gitignore.gitignoreSource [ ] ../.;
|
||||
# Do not run at pre-commit time
|
||||
default_stages = [
|
||||
"pre-push"
|
||||
];
|
||||
# TODO(mrtz): Remove when default
|
||||
package = pkgs.prek;
|
||||
# Linters From https://github.com/cachix/pre-commit-hooks.nix
|
||||
hooks = {
|
||||
nixfmt-rfc-style = {
|
||||
enable = true;
|
||||
excludes = globalExcludes;
|
||||
};
|
||||
|
||||
trim-trailing-whitespace.enable = true;
|
||||
|
||||
shellcheck = {
|
||||
enable = true;
|
||||
excludes = [
|
||||
"vcluster/"
|
||||
];
|
||||
args = [
|
||||
"-x"
|
||||
"-o"
|
||||
"all"
|
||||
];
|
||||
};
|
||||
|
||||
yamllint = {
|
||||
enable = false;
|
||||
excludes = [
|
||||
"attic/"
|
||||
"charts/templates/"
|
||||
"charts/charts/"
|
||||
];
|
||||
settings = {
|
||||
strict = true;
|
||||
configData = ''{ extends: default, rules: { document-start: disable, line-length: {max: 165} } }'';
|
||||
};
|
||||
};
|
||||
|
||||
check-json.enable = true;
|
||||
|
||||
renovate-config-validator = {
|
||||
enable = true;
|
||||
files = "renovate.json$";
|
||||
entry = "renovate-config-validator";
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
@@ -1,5 +1,18 @@
|
||||
{
|
||||
"pins": {
|
||||
"git-hooks": {
|
||||
"type": "Git",
|
||||
"repository": {
|
||||
"type": "GitHub",
|
||||
"owner": "cachix",
|
||||
"repo": "git-hooks.nix"
|
||||
},
|
||||
"branch": "master",
|
||||
"submodules": false,
|
||||
"revision": "b68b780b69702a090c8bb1b973bab13756cc7a27",
|
||||
"url": "https://github.com/cachix/git-hooks.nix/archive/b68b780b69702a090c8bb1b973bab13756cc7a27.tar.gz",
|
||||
"hash": "1k99smax7zpa5cdw9afa4v4y4155amy21a8z5z8x3cikdz3gyx5p"
|
||||
},
|
||||
"nixpkgs": {
|
||||
"type": "Channel",
|
||||
"name": "nixpkgs-unstable",
|
||||
|
||||
Reference in New Issue
Block a user