Skip to content

Commit

Permalink
Gate check tooling like linters behind developer mode flag
Browse files Browse the repository at this point in the history
  • Loading branch information
alerque committed Apr 6, 2024
1 parent 16530f7 commit 91b9e00
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
- name: Configure
run: |
./bootstrap.sh
./configure
./configure --enable-developer-mode
- name: Run tests
run: |
make check
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
echo "VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV
echo "${GITHUB_REF#refs/*/v}" > .tarball-version
./bootstrap.sh
./configure
./configure --enable-developer-mode
- name: Generate release-specific changelog
run: |
echo "PRERELEASE=${{ contains(env.VERSION, '-alpha') || contains(env.VERSION, '-beta') || contains(env.VERSION, '-rc') }}" >> $GITHUB_ENV
Expand Down
20 changes: 17 additions & 3 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ACLOCAL_AMFLAGS = -I build-aux
AM_DISTCHECK_CONFIGURE_FLAGS = --enable-developer-mode

.ONESHELL:
.SECONDARY:
Expand Down Expand Up @@ -68,17 +69,28 @@ prove:
.PHONY: test
test: prove

.PHONY: lint
PHONY_DEVELOPER_TARGETS = lint lint-editor-config lint-shellheck
.PHONY: $(PHONY_DEVELOPER_TARGETS)

if DEVELOPER_MODE

lint: lint-editor-config lint-shellcheck

.PHONY: lint-editor-config
lint-editor-config:
ec

.PHONY: lint-shellheck
lint-shellcheck: $(PACKAGE_NAME)
shellcheck $<

else !DEVELOPER_MODE

$(PHONY_DEVELOPER_TARGETS):
@: $(error "Please reconfigure using --enable-developer-mode to use developer tooling")

endif !DEVELOPER_MODE

if SOURCE_IS_GIT

CONTRIBUTORS:
exec > $@
echo 'Alphabetical list of names of everyone who ever committed to this repository.'
Expand All @@ -88,3 +100,5 @@ CONTRIBUTORS:

changelog-HEAD: changelog
sed -nEe '2d;s/^\t//p;/^$$/q;' $< > $@

endif SOURCE_IS_GIT
13 changes: 8 additions & 5 deletions build-aux/que_dist_checksums.m4
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
AC_DEFUN_ONCE([QUE_DIST_CHECKSUMS], [
QUE_PROGVAR([sha256sum])
QUE_PROGVAR([tee])
AM_COND_IF([DEVELOPER_MODE], [
QUE_TRANSFORM_PACKAGE_NAME
QUE_PROGVAR([sha256sum])
QUE_PROGVAR([tee])
AC_REQUIRE([AX_AM_MACROS])
AX_ADD_AM_MACRO([dnl
QUE_TRANSFORM_PACKAGE_NAME
AC_REQUIRE([AX_AM_MACROS])
AX_ADD_AM_MACRO([dnl
$(cat build-aux/que_dist_checksums.am)
])dnl
])
])
13 changes: 7 additions & 6 deletions build-aux/que_git_version.m4
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
AC_DEFUN_ONCE([QUE_GIT_VERSION], [
AC_PROG_AWK
AC_PROG_GREP
QUE_PROGVAR([cmp])
QUE_TRANSFORM_PACKAGE_NAME
AM_CONDITIONAL([SOURCE_IS_GIT],
[test -d .git])
Expand All @@ -15,6 +9,13 @@ AC_DEFUN_ONCE([QUE_GIT_VERSION], [
AM_CONDITIONAL([SOURCE_IS_ARCHIVE],
[test ! -d .git -a ! -f .tarball-version])
AC_PROG_AWK
AC_PROG_GREP
QUE_TRANSFORM_PACKAGE_NAME
AM_COND_IF([SOURCE_IS_DIST], [], [QUE_PROGVAR([cmp])])
AC_REQUIRE([AX_AM_MACROS])
AX_ADD_AM_MACRO([dnl
$(cat build-aux/que_git_version.am)
Expand Down
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ AC_ARG_WITH([standalone],
[])

QUE_TRANSFORM_PACKAGE_NAME
QUE_DEVELOPER_MODE

# These macros must be run after processing our standalone setup because
# they all expect the program name transformation setup to be complete.
Expand Down

0 comments on commit 91b9e00

Please sign in to comment.