From c3551def989ca5418468b64939f991ed042eabf1 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Sat, 4 Apr 2020 21:23:48 +0200 Subject: make: added a checkdoc target MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The implementation is somewhat dubious, but it does the job... Signed-off-by: Miquel Sabaté Solà --- Makefile | 7 ++++++- bin/checkdoc.sh | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100755 bin/checkdoc.sh diff --git a/Makefile b/Makefile index 8d57dfb..739d3bf 100644 --- a/Makefile +++ b/Makefile @@ -29,7 +29,7 @@ clean: ci: version all .PHONY: test -test: lint git-validation load-test +test: lint git-validation checkdoc load-test # Maybe it would've been nicer to use Cask or something like that, but it # doesn't have too many dependencies so it should be fine for now. @@ -77,3 +77,8 @@ load-test: (add-to-list 'custom-theme-load-path \"$(TOP)\") \ (load-theme 'soria t) \ (message \"%s\" soria-theme-hide-helm-header))" + +.PHONY: checkdoc +checkdoc: + @chmod +x ./bin/checkdoc.sh + @./bin/checkdoc.sh $(BATCH) -nw --load soria-theme.el diff --git a/bin/checkdoc.sh b/bin/checkdoc.sh new file mode 100755 index 0000000..d1a656a --- /dev/null +++ b/bin/checkdoc.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Copyright (C) 2020 Miquel Sabaté Solà +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# This whole file is an utter hack to workaround some issues I've had by +# directly evaluating Lisp code into the Makefile and then trying to make +# something out of it. Mostly, apparently checkdoc-* functions do not emit a +# proper exit code, and trying to get the output out of it (plus the nightmarish +# situation with Makefile) has been impossible. Instead, we are going to do +# everything here in good ol' bash. +# +# This script is expected to be called with a list of arguments which are the +# parts of the command to be used. This command will be suffixed by this script +# with the Lisp code. + +file="checkdoc.txt" +eval "$*" "--eval '(checkdoc-file \"soria-theme.el\")'" > "$file" 2>&1 +out=$(cat ${file}) +rm "$file" + +if [ "${out}" != "" ]; then + echo "$out" + exit 1 +fi + +exit 0 -- cgit v1.2.3