Perform full code validation on every make check.
[open-adventure.git] / Makefile
index fa18e6f58472b61fa48ca23c3e60625598115ca7..978d5a8912c927cd7ffdf33191d22c8015e49e7d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 # Makefile for the open-source release of adventure 2.5
 
-# SPDX-FileCopyrightText: Eric S. Raymond <esr@thyrsus.com>
+# SPDX-FileCopyrightText: (C) Eric S. Raymond <esr@thyrsus.com>
 # SPDX-License-Identifier: BSD-2-Clause
 
 # To build with save/resume disabled, pass CFLAGS="-DADVENT_NOSAVE"
@@ -65,9 +65,20 @@ clean:
 cheat: $(CHEAT_OBJS) dungeon.o
        $(CC) $(CCFLAGS) $(DBX) -o cheat $(CHEAT_OBJS) dungeon.o $(LDFLAGS) $(LIBS)
 
-check: advent cheat
+CSUPPRESSIONS = --suppress=missingIncludeSystem --suppress=invalidscanf
+cppcheck:
+       @-cppcheck -I. --quiet --template gcc -UPROP_SET_SEEN --enable=all $(CSUPPRESSIONS) *.[ch]
+
+pylint:
+       @-pylint --score=n *.py */*.py
+
+check: advent cheat pylint cppcheck
        cd tests; $(MAKE) --quiet
 
+reflow:
+       @clang-format --style="{IndentWidth: 8, UseTab: ForIndentation}" -i $$(find . -name "*.[ch]")
+       @black --quiet *.py
+
 # Requires gcov, lcov, libasan6, and libubsan1
 # The last two are Ubuntu names, might vary on other distributions.
 # After this, run your browser on coverage/open-adventure/index.html
@@ -147,9 +158,3 @@ debug: CCFLAGS += -fsanitize=address
 debug: CCFLAGS += -fsanitize=undefined
 debug: linty
 
-CSUPPRESSIONS = --suppress=missingIncludeSystem --suppress=invalidscanf
-cppcheck:
-       cppcheck -I. --template gcc --enable=all $(CSUPPRESSIONS) *.[ch]
-
-pylint:
-       @pylint --score=n *.py */*.py