Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
BCM Server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MSK-SW
Special Diagnostics
BCM
BCM Server
Merge requests
!2
feat(project-template): clang-tidy targets
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
feat(project-template): clang-tidy targets
update-project-template
into
master
Overview
0
Commits
2
Pipelines
0
Changes
3
Merged
Martin Christoph Hierholzer
requested to merge
update-project-template
into
master
1 year ago
Overview
0
Commits
2
Pipelines
0
Changes
3
Expand
Add clang-tidy targets to project
add .clang-tidy file containing our settings and some configs according to our coding guidelines
add three explicit targets for calling just lint or lint-and-fix, lint-and-fix-and-commit-after-each-fix
add enable-able support for CMake"s "native" clang-tidy support (makes build super-slow)
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
a8140095
2 commits,
1 year ago
3 files
+
121
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
Search (e.g. *.vue) (Ctrl+P)
cmake/add_linter_target.cmake
0 → 100644
+
13
−
0
Options
set
(
CTK_CLANG_TIDY_VERSION
"14"
CACHE STRING
"Version of the clang-tidy binary to use"
)
set
(
CTK_ENABLE_TIDY_WHILE_BUILDING OFF CACHE BOOL
"Whether to run clang-tidy on every compilation unit"
)
if
(
CTK_ENABLE_TIDY_WHILE_BUILDING
)
set
(
CMAKE_CXX_CLANG_TIDY /usr/bin/clang-tidy-
${
CTK_CLANG_TIDY_VERSION
}
;-config-file=
${
CMAKE_SOURCE_DIR
}
/.clang-tidy
)
set
(
CMAKE_C_CLANG_TIDY /usr/bin/clang-tidy-
${
CTK_CLANG_TIDY_VERSION
}
;-config-file=
${
CMAKE_SOURCE_DIR
}
/.clang-tidy
)
endif
()
set
(
CMAKE_EXPORT_COMPILE_COMMANDS ON
)
add_custom_target
(
run-linter COMMAND run-clang-tidy-
${
CTK_CLANG_TIDY_VERSION
}
-p
${
CMAKE_BINARY_DIR
}
WORKING_DIRECTORY
${
CMAKE_SOURCE_DIR
}
)
add_custom_target
(
fix-linter-stepwise COMMAND
${
CMAKE_SOURCE_DIR
}
/cmake/fix-linter-for-all.py --tidy=clang-tidy-
${
CTK_CLANG_TIDY_VERSION
}
--apply-tool=clang-apply-replacements-
${
CTK_CLANG_TIDY_VERSION
}
--exclude=
"
${
CMAKE_BINARY_DIR
}
"
${
CMAKE_BINARY_DIR
}
/compile_commands.json
WORKING_DIRECTORY
${
CMAKE_SOURCE_DIR
}
)
add_custom_target
(
fix-linter COMMAND run-clang-tidy-
${
CTK_CLANG_TIDY_VERSION
}
-fix -format -p
${
CMAKE_BINARY_DIR
}
WORKING_DIRECTORY
${
CMAKE_SOURCE_DIR
}
)
Loading