Browse Source

Add clang-tidy tests to target checkstyle

Robin Krahl 1 year ago
parent
commit
049a90ed8a
1 changed files with 8 additions and 1 deletions
  1. 8
    1
      Makefile

+ 8
- 1
Makefile View File

@@ -40,13 +40,15 @@ LDFLAGS += $(LDFLAGS_SQLITE3)
40 40
 LDFLAGS_LIB += -Wl,-soname,lib$(TARGET_NAME_LIB).so.$(VERSION_MAJOR)
41 41
 LDFLAGS_TEST += -L$(LIBRARY_DIR) -l$(TARGET_NAME_LIB) $(LDFLAGS_GTEST) -Wl,-rpath,$(LIBRARY_DIR)
42 42
 
43
+CLANG_TIDY_CHECKS := "clang*,cppcoreguidelines*,modernize*,readability*"
44
+
43 45
 ifdef VERBOSE
44 46
 	QUIET :=
45 47
 else
46 48
 	QUIET := @
47 49
 endif
48 50
 
49
-.PHONY = all clean doc memcheck test
51
+.PHONY = all checkstyle clean doc memcheck test
50 52
 
51 53
 all: $(TARGETS)
52 54
 
@@ -60,6 +62,11 @@ clean:
60 62
 	$(info (RM)    $(DOCUMENTATION_DIR))
61 63
 	$(QUIET)$(RM) -r $(DOCUMENTATION_DIR)
62 64
 
65
+checkstyle:
66
+	clang-tidy --checks=$(CLANG_TIDY_CHECKS) \
67
+		$(INCLUDES) $(SOURCES_LIB) \
68
+		-- -x c++ $(CPPFLAGS) $(CXXFLAGS)
69
+
63 70
 doc: $(INCLUDES)
64 71
 	(cat Doxyfile ; echo "PROJECT_NUMBER=$(VERSION)" ) | doxygen -
65 72
 

Loading…
Cancel
Save