aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2015-10-02 11:19:11 +1300
committerTom Ryder <tom@sanctum.geek.nz>2015-10-02 11:19:11 +1300
commit901b8896afb2dc37357769063779935a531a1bca (patch)
tree98dfc92689fe097e8cbeed7689122787305ea444
parentAppease shellcheck with multi arith exps (diff)
downloaddotfiles-901b8896afb2dc37357769063779935a531a1bca.tar.gz
dotfiles-901b8896afb2dc37357769063779935a531a1bca.zip
Add linting targets
-rw-r--r--Makefile14
-rw-r--r--README.markdown4
2 files changed, 18 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index c2d4b5fd..8d0917bf 100644
--- a/Makefile
+++ b/Makefile
@@ -260,3 +260,17 @@ test-urxvt:
done
@printf 'All Perl scripts in urxvt/ext parsed successfully.\n'
+lint : lint-sh lint-bash lint-bin lint-urxvt
+
+lint-sh :
+ find sh -type f -print -exec shellcheck -- {} \;
+
+lint-bash :
+ find bash -type f -print -exec shellcheck -- {} \;
+
+lint-bin :
+ find bin -type f -print -exec shellcheck -- {} \;
+
+lint-urxvt:
+ find urxvt/ext -type f -print -exec perlcritic --brutal -- {} \;
+
diff --git a/README.markdown b/README.markdown
index 04639b01..4ad5bd8b 100644
--- a/README.markdown
+++ b/README.markdown
@@ -202,6 +202,10 @@ You can test that both sets of shell scripts are syntactically correct with
`make test-bash`, `make test-sh`, or `make test` for everything including the
scripts in `bin`.
+If you have `shellcheck(1)` and/or `perlcritic(1)`, there's a `lint` target
+too for the shell script files and Perl files respectively, but the files don’t
+need to pass that check to be installed.
+
GnuPG
-----