My name is Upper Camel. (My partner drew this mascot for the project)
Windows | Linux | macOS |
---|---|---|
The project is a naming convention checking tool executing on Windows/Linux/MacOS. It is based on LLVM's LibTooling as a compiler frontend to retrieve AST of C/C++ source files, then check your naming convention.
- Check for C and C++ programming languages.
- Check naming of file, functions, variables, and parameters.
- Execute on Windows/Linux/macOS.
- Load config file format with TOML.
- Output results to console or save an a JSON file.
- Support rules with UpperCamelCase, lowerCamelCase, UPPER_SNAKE_CASE, lower_snake_case, and szHungarainNotion..
⭐ If you like this project or this project gives you some help, please also give me a STAR on GitHub, let me know I am not alone.
————————————————————————————————————————————
-
As an user:
- Use it, please goto the
release
page to download the artifacts files by Azure DevOps. https://github.com/dougpuob/cpp-namelint/releases - Know more, please start from Usage.
- Use it, please goto the
-
As a developer
- Build this project, https://github.com/dougpuob/cpp-namelint/blob/master/doc/how-to-build-cppnamelint.md
- Build LLVM, https://github.com/dougpuob/cpp-namelint/blob/master/doc/how-to-build-llvm.md
- example-llvm-clangtool, https://github.com/dougpuob/example-llvm-clangtool
————————————————————————————————————————————
-
Run Check command
cppnamelint check YouPlayGround.cpp -config cppnamelint.toml
cppnamelint check YouPlayGround.cpp -config cppnamelint.toml -jsonout result.json
cppnamelint check YouPlayGround.cpp -config cppnamelint.toml -jsonout result.json -logfile logout.log
-
Run Test command
cppnamelint test
————————————————————————————————————————————
————————————————————————————————————————————
C:\>cppnamelint.exe check YouPlayGround.cpp -config cppnamelint.toml
cppnamelint utility v0.3.1
---------------------------------------------------
File = YouPlayGround.cpp
Config = cppnamelint.toml
Checked = 6 [File:0 | Func: 5 | Param: 1 | Var: 0 | Enum: 0 | Struct: 0 | Union: 0 | Class: 0]
Error = 0 [File:0 | Func: 0 | Param: 0 | Var: 0 | Enum: 0 | Struct: 0 | Union: 0 | Class: 0]
------------------------------------------------------------
C:\>cppnamelint.exe check YouPlayGround.cpp -config cppnamelint.toml
cppnamelint utility v0.3.1
---------------------------------------------------
File = YouPlayGround.cpp
Config = cppnamelint.toml
Checked = 6 [File:0 | Func: 5 | Param: 1 | Var: 0 | Enum: 0 | Struct: 0 | Union: 0 | Class: 0]
Error = 1 [File:0 | Func: 0 | Param: 1 | Var: 0 | Enum: 0 | Struct: 0 | Union: 0 | Class: 0]
------------------------------------------------------------
< 16, 25> Parameter : inputValue (int)
------------------------------------------------------------
[{
"Checked": {
"Function": 5,
"Parameter": 1,
"Variable": 0
},
"Error": {
"Function": 0,
"Parameter": 1,
"Variable": 0
},
"ErrorDetailList": [
{
"Column": 25,
"Expected": "",
"Line": 16,
"TargetName": "inputValue",
"Type": 4,
"TypeName": "int"
}
],
"File": {
"Config": "cppnamelint.toml",
"Source": "C:\\petzone\\cpp-namelint\\sample\\YouPlayGround.cpp"
}
}]
————————————————————————————————————————————
Douglas Chen dougpuob@gmail.com
————————————————————————————————————————————
MIT