Skip to content

Commit

Permalink
Astyle clang-tidy test headers in Makefile (CleverRaven#50129)
Browse files Browse the repository at this point in the history
* Astyle clang-tidy test headers in Makefile

* Do not skip astyle on relevant changes

* Astyle tools/clang-tidy-plugin/test-include/mock-translation.h
  • Loading branch information
Qrox authored Jul 22, 2021
1 parent 7aa5a30 commit 6d52144
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/astyle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
with:
cancel_others: 'true'
concurrent_skipping: 'outdated_runs'
paths: '["**.cpp", "**.h", "**.c"]'
paths: '[".github/workflows/astyle.yml", "Makefile", ".astylerc", "**.cpp", "**.h", "**.c"]'
astyle-code:
name: astyle check
needs: skip-duplicates
Expand Down
11 changes: 7 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -851,21 +851,24 @@ SOURCES := $(wildcard $(SRC_DIR)/*.cpp)
HEADERS := $(wildcard $(SRC_DIR)/*.h)
TESTSRC := $(wildcard tests/*.cpp)
TESTHDR := $(wildcard tests/*.h)
JSON_FORMATTER_SOURCES := tools/format/format.cpp tools/format/format_main.cpp src/json.cpp
CHKJSON_SOURCES := src/chkjson/chkjson.cpp src/json.cpp
JSON_FORMATTER_SOURCES := $(wildcard tools/format/*.cpp) src/json.cpp
JSON_FORMATTER_HEADERS := $(wildcard tools/format/*.h)
CHKJSON_SOURCES := $(wildcard src/chkjson/*.cpp) src/json.cpp
CLANG_TIDY_PLUGIN_SOURCES := \
$(wildcard tools/clang-tidy-plugin/*.cpp tools/clang-tidy-plugin/*/*.cpp)
TOOLHDR := $(wildcard tools/*/*.h)
CLANG_TIDY_PLUGIN_HEADERS := \
$(wildcard tools/clang-tidy-plugin/*.h tools/clang-tidy-plugin/*/*.h)
# Using sort here because it has the side-effect of deduplicating the list
ASTYLE_SOURCES := $(sort \
$(SOURCES) \
$(HEADERS) \
$(TESTSRC) \
$(TESTHDR) \
$(JSON_FORMATTER_SOURCES) \
$(JSON_FORMATTER_HEADERS) \
$(CHKJSON_SOURCES) \
$(CLANG_TIDY_PLUGIN_SOURCES) \
$(TOOLHDR))
$(CLANG_TIDY_PLUGIN_HEADERS))

_OBJS = $(SOURCES:$(SRC_DIR)/%.cpp=%.o)
ifeq ($(TARGETSYSTEM),WINDOWS)
Expand Down
6 changes: 3 additions & 3 deletions tools/clang-tidy-plugin/test-include/mock-translation.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ string operator+( const string &, const string & );
} // namespace std

// check_clang_tidy uses -nostdinc++, so we add dummy translation interface here instead of including translations.h
namespace detail {
namespace detail
{

template<typename T>
struct local_translation_cache
{
struct local_translation_cache {
T operator()( T arg );
};

Expand Down

0 comments on commit 6d52144

Please sign in to comment.