-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configure clang-tidy job on CI #6261
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,85 @@ | ||
--- | ||
Checks: '-clang-analyzer-*,google-*,llvm-*,misc-*,readability-*,-google-build-explicit-make-pair,-google-explicit-constructor,-google-readability-braces-around-statements,-google-readability-casting,-google-readability-namespace-comments,-google-readability-function,-google-readability-todo,-google-runtime-int,-llvm-namespace-comment,-llvm-header-guard,-llvm-twine-local,-misc-argument-comment,-readability-braces-around-statements,-readability-identifier-naming' | ||
... | ||
Checks: > | ||
bugprone-*, | ||
-bugprone-narrowing-conversions, | ||
-bugprone-easily-swappable-parameters, | ||
-bugprone-branch-clone, | ||
-bugprone-misplaced-widening-cast, | ||
-bugprone-exception-escape, | ||
-bugprone-implicit-widening-of-multiplication-result, | ||
-bugprone-integer-division, | ||
-bugprone-reserved-identifier, | ||
-bugprone-macro-parentheses, | ||
-bugprone-unhandled-self-assignment, | ||
-bugprone-suspicious-missing-comma, | ||
-bugprone-forward-declaration-namespace, | ||
-bugprone-sizeof-expression, | ||
-clang-analyzer-*, | ||
-clang-diagnostic-unused-local-typedef, | ||
-clang-diagnostic-deprecated-declarations, | ||
google-*, | ||
-google-build-explicit-make-pair, | ||
-google-build-using-namespace, | ||
-google-explicit-constructor, | ||
-google-default-arguments, | ||
-google-readability-braces-around-statements, | ||
-google-readability-casting, | ||
-google-readability-namespace-comments, | ||
-google-readability-function, | ||
-google-readability-todo, | ||
-google-runtime-int, | ||
-google-build-namespaces, | ||
-google-global-names-in-headers, | ||
-google-runtime-references, | ||
-google-readability-function-size, | ||
llvm-*, | ||
-llvm-namespace-comment, | ||
-llvm-qualified-auto, | ||
-llvm-include-order, | ||
-llvm-else-after-return, | ||
-llvm-header-guard, | ||
-llvm-twine-local, | ||
misc-*, | ||
-misc-argument-comment, | ||
-misc-non-private-member-variables-in-classes, | ||
-misc-unused-using-decls, | ||
-misc-unconventional-assign-operator, | ||
-misc-redundant-expression, | ||
-misc-no-recursion, | ||
-misc-misplaced-const, | ||
-misc-definitions-in-headers, | ||
-misc-unused-alias-decls, | ||
-misc-unused-parameters, | ||
readability-*, | ||
-readability-avoid-const-params-in-decls, | ||
-readability-braces-around-statements, | ||
-readability-container-size-empty, | ||
-readability-convert-member-functions-to-static, | ||
-readability-const-return-type, | ||
-readability-function-cognitive-complexity, | ||
-readability-function-size, | ||
-readability-identifier-naming, | ||
-readability-implicit-bool-conversion, | ||
-readability-magic-numbers, | ||
-readability-else-after-return, | ||
-readability-inconsistent-declaration-parameter-name, | ||
-readability-isolate-declaration, | ||
-readability-redundant-declaration, | ||
-readability-uppercase-literal-suffix, | ||
-readability-named-parameter, | ||
-readability-qualified-auto, | ||
-readability-suspicious-call-argument, | ||
-readability-redundant-access-specifiers, | ||
-readability-redundant-member-init, | ||
-readability-static-definition-in-anonymous-namespace, | ||
-readability-use-anyofallof, | ||
-readability-simplify-boolean-expr, | ||
-readability-make-member-function-const, | ||
-readability-redundant-string-init, | ||
-readability-non-const-parameter, | ||
-readability-static-accessed-through-instance | ||
|
||
WarningsAsErrors: '*' | ||
HeaderFilterRegex: '.*' | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,6 +85,16 @@ jobs: | |
CLANG_VERSION: 5.0.0 | ||
CUCUMBER_TIMEOUT: 60000 | ||
|
||
- name: clang-11.0-debug-clang-tidy | ||
continue-on-error: false | ||
node: 12 | ||
runs-on: ubuntu-20.04 | ||
BUILD_TOOLS: ON | ||
BUILD_TYPE: Debug | ||
CLANG_VERSION: 11.0.0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
CUCUMBER_TIMEOUT: 60000 | ||
ENABLE_CLANG_TIDY: ON | ||
|
||
- name: mason-linux-debug-asan | ||
continue-on-error: false | ||
node: 12 | ||
|
@@ -365,6 +375,7 @@ jobs: | |
CXXCOMPILER: ${{ matrix.CXXCOMPILER }} | ||
CXXFLAGS: ${{ matrix.CXXFLAGS }} | ||
ENABLE_ASSERTIONS: ${{ matrix.ENABLE_ASSERTIONS }} | ||
ENABLE_CLANG_TIDY: ${{ matrix.ENABLE_CLANG_TIDY }} | ||
ENABLE_COVERAGE: ${{ matrix.ENABLE_COVERAGE }} | ||
ENABLE_GLIBC_WORKAROUND: ${{ matrix.ENABLE_GLIBC_WORKAROUND }} | ||
ENABLE_MASON: ${{ matrix.ENABLE_MASON }} | ||
|
@@ -490,7 +501,8 @@ jobs: | |
pushd ${OSRM_BUILD_DIR} | ||
cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ | ||
-DENABLE_MASON=${ENABLE_MASON:-OFF} \ | ||
-DENABLE_ASSERTIONS=${ENABLE_ASSERTIONS:-OFF}} \ | ||
-DENABLE_ASSERTIONS=${ENABLE_ASSERTIONS:-OFF} \ | ||
-DENABLE_CLANG_TIDY=${ENABLE_CLANG_TIDY:-OFF} \ | ||
-DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS:-OFF} \ | ||
-DENABLE_COVERAGE=${ENABLE_COVERAGE:-OFF} \ | ||
-DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,8 +50,11 @@ struct duplicated_node | |
}; | ||
} // namespace tag | ||
using OSMNodeID = osrm::Alias<std::uint64_t, tag::osm_node_id>; | ||
// clang-tidy fires `bugprone-throw-keyword-missing` here for unknown reason | ||
// NOLINTNEXTLINE(bugprone-throw-keyword-missing) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are these needed? I can omit these with clang 11. Doesn't appear to match the description either. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, for some reason it fires for me locally. I'll add a comment that it is intentional. 👍🏻 |
||
static_assert(std::is_pod<OSMNodeID>(), "OSMNodeID is not a valid alias"); | ||
using OSMWayID = osrm::Alias<std::uint64_t, tag::osm_way_id>; | ||
// NOLINTNEXTLINE(bugprone-throw-keyword-missing) | ||
static_assert(std::is_pod<OSMWayID>(), "OSMWayID is not a valid alias"); | ||
|
||
using DuplicatedNodeID = std::uint64_t; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ dirty=$(git ls-files --modified) | |
if [[ $dirty ]]; then | ||
echo $MSG | ||
echo $dirty | ||
git diff | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I use Apple Silicon mac, that's why script for formatting code doesn't work locally for me. It helped me to understand what CI wants from me to be formatted. |
||
exit 1 | ||
else | ||
exit 0 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many of them are really useful, but fixing all of them is time consuming and it is better to do in separate PRs.