Skip to content

Commit c2f9c2c

Browse files
committed
Add project clangtidy
1 parent 35830f2 commit c2f9c2c

File tree

4 files changed

+37
-0
lines changed

4 files changed

+37
-0
lines changed

projects/clangtidy/.clang-tidy

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
Checks: readability-identifier-naming
3+
CheckOptions:
4+
- { key: readability-identifier-naming.NamespaceCase, value: lower_case }

projects/clangtidy/Readme.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## clangtidy
2+
3+
Test [`clangtidy`](https://premake.github.io/docs/clangtidy)

projects/clangtidy/premake5.lua

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
if (_ACTION == nil) then
2+
return
3+
end
4+
5+
local LocationDir = "solution/%{_ACTION}"
6+
7+
workspace "Project"
8+
location(LocationDir)
9+
configurations {"Debug", "Release"}
10+
11+
objdir(path.join(LocationDir, "obj")) -- premake adds $(configName)/$(AppName)
12+
targetdir(path.join(LocationDir, "bin/%{cfg.buildcfg}"))
13+
14+
startproject "app"
15+
16+
project "app"
17+
kind "ConsoleApp"
18+
targetname "app"
19+
20+
files { "src/main.cpp" }
21+
clangtidy "On"
22+

projects/clangtidy/src/main.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
3+
namespace ShouldBeLowerCase { // warning: invalid case style for namespace 'ShouldBeLowerCase' [readability-identifier-naming]
4+
}
5+
6+
int main()
7+
{
8+
}

0 commit comments

Comments
 (0)