Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
LDD server configuration
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
Infrastructure and Support
Laser Diode Driver
LDD server configuration
Merge requests
!4
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
Viewing commit
0521eb5f
Prev
Next
Show latest version
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)
0521eb5f
Merge project-template (automated)
· 0521eb5f
Martin Christoph Hierholzer
authored
1 year ago
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