File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed
Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -2276,6 +2276,28 @@ in
22762276 package = tools . chktex ;
22772277 entry = "${ hooks . chktex . package } /bin/chktex" ;
22782278 } ;
2279+ circleci =
2280+ {
2281+ name = "circleci" ;
2282+ description = "Validate CircleCI config files." ;
2283+ package = tools . circleci-cli ;
2284+ entry = builtins . toString ( pkgs . writeShellScript "precommit-circleci" ''
2285+ set -e
2286+ failed=false
2287+ for file in "$@"; do
2288+ if ! ${ hooks . circleci . package } /bin/circleci config validate "$file" 2>&1
2289+ then
2290+ echo "Config file at $file is invalid, check the errors above."
2291+ failed=true
2292+ fi
2293+ done
2294+ if [[ $failed == "true" ]]; then
2295+ exit 1
2296+ fi
2297+ '' ) ;
2298+ files = "^.circleci/" ;
2299+ types = [ "yaml" ] ;
2300+ } ;
22792301 clang-format =
22802302 {
22812303 name = "clang-format" ;
Original file line number Diff line number Diff line change 1111, callPackage
1212, cargo
1313, checkmake
14+ , circleci-cli
1415, llvmPackages_latest
1516, clippy
1617, cljfmt
111112 cabal-fmt
112113 cabal-gild
113114 cargo
115+ circleci-cli
114116 clippy
115117 cljfmt
116118 cmake-format
You can’t perform that action at this time.
0 commit comments