Skip to content

Commit 998abf0

Browse files
committed
Integration scripts for Clang's Modernize and Tidy tool.
New directory: `scripts/`, in which small scripts for developers reside. - `modernize`: runs all cpp files through `clang-modernize`, respecting out targeted compiler versions, applying C++11 transformations, doing syntax checks and formatting --- in parallel. - `tidy`: runs all cpp files through `clang-tidy`, with selected warnings only, since we do not want to warn on every small detail. Please check the talk slides for `clang-tidy` linked in the references! References: - http://clang.llvm.org/extra/clang-tidy/ - http://llvm.org/devmtg/2014-04/PDFs/Talks/clang-tidy%20LLVM%20Euro%202014.pdf - http://clang.llvm.org/extra/clang-tidy/checks/list.html - #1603
1 parent aab5092 commit 998abf0

File tree

4 files changed

+17
-1
lines changed

4 files changed

+17
-1
lines changed

.clang-tidy

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
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'
3+
...
4+

scripts/modernize.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env bash
2+
3+
# Runs the Clang Modernizer in parallel on the code base.
4+
# Requires a compilation database in the build directory.
5+
6+
git ls-files '*.cpp' | xargs -I{} -P $(nproc) clang-modernize -p build -final-syntax-check -format -style=file -summary -for-compilers=clang-3.4,gcc-4.8 -include . -exclude third_party {}

scripts/tidy.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env bash
2+
3+
# Runs the Clang Tidy Tool in parallel on the code base.
4+
# Requires a compilation database in the build directory.
5+
6+
git ls-files '*.cpp' | grep -v third_party | xargs -I{} -P $(nproc) clang-tidy -p build -header-filter='.*' {}

update_depdendencies.sh renamed to scripts/update_depdendencies.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
OSMIUM_REPO=https://github.com/osmcode/libosmium.git
44
OSMIUM_TAG=v2.3.0
55

6-
VARIANT_REPO=https://github.com/mapbox/variant.git
6+
VARIANT_REPO=https://github.com/mapbox/variant.git
77
VARIANT_TAG=v1.0
88

99
VARIANT_LATEST=$(curl https://api.github.com/repos/mapbox/variant/releases/latest | jq ".tag_name")

0 commit comments

Comments
 (0)