Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected findings #65

Open
ruedbi opened this issue Apr 20, 2021 · 10 comments
Open

Unexpected findings #65

ruedbi opened this issue Apr 20, 2021 · 10 comments

Comments

@ruedbi
Copy link

ruedbi commented Apr 20, 2021

based on 96c8b87

  1. looks like that a constructor is not checked for the class name pattern, but the one of the function (here: lowerCamel), like so:
    File = 2.04.initializer.list.cpp
    Config = cppnamelint.toml
    Checked = 16 [File:0 | Func: 4 | Param: 4 | Var: 8 | Enum: 0 | Struct: 0 | Union: 0 | Class: 2]
    Error = 2 [File:0 | Func: 2 | Param: 0 | Var: 0 | Enum: 0 | Struct: 0 | Union: 0 | Class: 0]

< 18, 5> Function : Foo
< 24, 5> Function : MagicFoo

The same applies to structs:
File = 10.2.concepts.cpp
Config = cppnamelint.toml
Checked = 35 [File:0 | Func: 13 | Param: 7 | Var: 12 | Enum: 0 | Struct: 3 | Union: 0 | Class: 1]
Error = 26 [File:0 | Func: 7 | Param: 7 | Var: 10 | Enum: 0 | Struct: 2 | Union: 0 | Class: 0]

< 30, 5> Function : Person

  1. "Parameters" are reported without configuration that could be set, and disable reporting is also not possible (the TODO?)

  2. Add any namespace around the code in e.g. 10.2.concepts.cpp and the errors will melt down to a few only:

File = 10.2.concepts.cpp
Config = cppnamelint.toml
Checked = 13 [File:0 | Func: 3 | Param: 3 | Var: 4 | Enum: 0 | Struct: 3 | Union: 0 | Class: 0]
Error = 9 [File:0 | Func: 2 | Param: 3 | Var: 2 | Enum: 0 | Struct: 2 | Union: 0 | Class: 0]

< 40, 16> Parameter : a (double)
< 40, 26> Parameter : b (double)
< 41, 9> Function : to_string
< 50, 9> Function : to_string
< 50, 26> Parameter : l (list)
< 52, 13> Variable : s (string)
< 62, 5> Variable : to_string (string)

  1. I have some cases where cppnamelint stops after the first line of code. I cannot say when that happens / what the rule is,
    baut at least "VariableName = 2" (or 3) seems to be required with UpperCamel classe name (other combinations not tested).
    I could create a simple class like
    class BlaBla
    {
    int someVar;
    };
    then the class gets detected as a variable
    Checked = 1 [File:0 | Func: 0 | Param: 0 | Var: 1 | Enum: 0 | Struct: 0 | Union: 0 | Class: 0]
    Error = 1 [File:0 | Func: 0 | Param: 0 | Var: 1 | Enum: 0 | Struct: 0 | Union: 0 | Class: 0]

< 1, 1> Variable : BlaBla (class)
the log then ends with
[2021-04-20 12:49:39.948] [] [info] Program is going to close. (iRet=1)
the real variable someVar does not even get checked

Can you reproduce that issue?

All for now, thanks a lot for your efforts!

@dougpuob
Copy link
Owner

Hi @ruedbi :

Glad to receive your reports. There are lots of information, something doesn't be checked, and an error(Q3). Seems something I forget to implement (struct, class, parameter, union). I will confirm it again with source code. Unimplemented functions I will create issues for them. About the error, I will try to duplicate later after those functions done.

Reply you later.

@dougpuob
Copy link
Owner

dougpuob commented May 5, 2021

Hi @ruedbi:

Sorry, reply you late, a little busy recently.

1. About the 1st issue about constructor is not check.
Ctor is a function, but the name must be identical to class name. It will be confuse if value of General.Rules.ClassName and General.Rules.FunctionName are different in config file. So I skip checking the name of ctro and dtor.

2. "Parameters" are reported without configuration that could be set
YES. Now this tool checks parameter declare and variable declare with the same rule. I will make the General.Options.CheckParameter work, making them can be checked separately.

3. Add any namespace around the code in e.g. 10.2.concepts.cpp and the errors will melt down to a few only
I didn't get you, but I'm curious abt can it be compiled successfully after changing? If possible, can you show me your change?

4. I have some cases where cppnamelint stops after the first line of code. I cannot say when that happens, what the rule is?
I got different result with you. Can you show me more details, sample code files will be better.

PS > type C:\petzone\cppnamelint\cppnamelint.git\source\test\sample\YouPlayGround.cpp
class BlaBla
{
int someVar;
};
PS > ./cppnamelint check C:\petzone\cppnamelint\cppnamelint.git\source\test\sample\YouPlayGround.cpp --config=C:\petzone\cppnamelint\cppnamelint.git\cppnamelint.toml

cppnamelint utility v0.3.4
---------------------------------------------------
 File    = YouPlayGround.cpp
 Config  = cppnamelint.toml
 Checked =     1  [File:0 | Func:  0 | Param:  0 | Var:  1 | Enum:  0 | Struct:  0 | Union:  0 | Class:  1]
 Error   =     1  [File:0 | Func:  0 | Param:  0 | Var:  1 | Enum:  0 | Struct:  0 | Union:  0 | Class:  0]
------------------------------------------------------------
  <   3,    1> Variable  : someVar (int)

@ruedbi
Copy link
Author

ruedbi commented May 10, 2021

thanks for checking
and sorry for the ugly formatting, I just don't get rid of that

ad 1): I understand that this means a change in cppnamelint (just to be sure)? Would be ok for me.
ad 2) nice!

ad 3)
I'm testing with 96c8b87 with unmodified settings file
I'll attach the cpp-file with the namespace inserted, which gives me these results, one with namespace, one without:
10.2.concepts.zip

cppnamelint utility v0.3.4

INFO : Log message will print to the file (y).

File = 10.2.concepts.cpp
Config = cppnamelint.toml
Checked = 13 [File:0 | Func: 3 | Param: 3 | Var: 4 | Enum: 0 | Struct: 3 | Union: 0 | Class: 0]
Error = 9 [File:0 | Func: 2 | Param: 3 | Var: 2 | Enum: 0 | Struct: 2 | Union: 0 | Class: 0]

< 40, 12> Parameter : a (double)
< 40, 22> Parameter : b (double)
< 41, 5> Function : to_string
< 50, 5> Function : to_string
< 50, 22> Parameter : l (list)
< 52, 9> Variable : s (string)
< 62, 1> Variable : to_string (string)

cppnamelint utility v0.3.4

INFO : Log message will print to the file (y).

File = 10.2.concepts.cpp
Config = cppnamelint.toml
Checked = 35 [File:0 | Func: 13 | Param: 7 | Var: 12 | Enum: 0 | Struct: 3 | Union: 0 | Class: 1]
Error = 28 [File:0 | Func: 9 | Param: 7 | Var: 10 | Enum: 0 | Struct: 2 | Union: 0 | Class: 0]

< 40, 12> Parameter : a (double)
< 40, 22> Parameter : b (double)
< 41, 5> Function : to_string
< 50, 5> Function : to_string
< 50, 22> Parameter : l (list)
< 52, 9> Variable : s (string)
< 62, 1> Function : to_string
< 62, 18> Parameter : v (std::vector)
< 64, 5> Variable : s (string)
< 72, 1> Function : print
< 72, 12> Parameter : a (Stringable)
< 77, 1> Function : print
< 77, 12> Parameter : a (HasStringFunc)
< 84, 5> Variable : l (std::list)
< 85, 5> Variable : p (Person)
< 86, 5> Variable : v (std::vector)
< 98, 5> Function : executeOnEntry
< 99, 5> Function : executeOnExit
< 100, 5> Function : doExecute
< 101, 17> Parameter : errorInputFilter (ErrorInputFilter)
< 102, 5> Variable : signalSyssmExit (SignalExit)
< 103, 5> Variable : myTest (int)
< 104, 5> Variable : MyTest (int)
< 105, 5> Function : Some_Func
< 108, 5> Variable : _errorInputFilter (ErrorInputFilter)
< 109, 5> Variable : TestTest (int)

this is just a demo, it is not about wether the code can be compiled in the tutorial like that

ad 4): Unfortunately I cannot reproduce now either ...
maybe the issue returns when (3) gets fixed, so I can work on my project code again

@dougpuob
Copy link
Owner

Hi @ruedbi

About the ad 3)
This tool is based on AST(LLVM's libtooling), so compile successfully is important.

@ruedbi
Copy link
Author

ruedbi commented May 14, 2021

not sure if I get you right
I guess that by "compile successfully" you mean compile with clang via cppnamelint, right? Not the compile from the modern c++ (which I cannot do because of not allowed to install packages)
if yes, it obviously does (checked with --verbose)
if not, let me know
thanks!

@dougpuob
Copy link
Owner

not sure if I get you right
I guess that by "compile successfully" you mean compile with clang via cppnamelint, right? Not the compile from the modern c++ (which I cannot do because of not allowed to install packages)
if yes, it obviously does (checked with --verbose)
if not, let me know
thanks!

According to the ad 3). The sample code in 10.2.concepts.zip cannot be compiled with gcc too (https://godbolt.org/z/KP6Ezzco3). My meaning is to run this tool after projects were compiled successful, because it is an AST based utility.

@ruedbi
Copy link
Author

ruedbi commented May 17, 2021

got it
10.2 does not compile because of that new "concept" keyword (C++20), it is not related to the added "namespace"
but sure that does not help here
BTW: interesting tool (godbolt), thanks for the hint

I'll try again with my code and see what I'll find

@ruedbi
Copy link
Author

ruedbi commented May 17, 2021

I upgraded to 4883fa3

  1. finding with --verbose:
    I cannot add include paths so that they appear in
    #include "..." search starts here:

    #include <...> search starts here:

    still in the clang invocation they are added correctly with "-I", and not with "-internal-isystem"
    probably not a bug

  2. Is it expected to check .h files explicitly, or should they only be checked implicitly when included from a .cpp file?
    I guess the latter one is true.

I tried another example that I appended.
Both files in the root folder, they compile with gcc, cppnamelint with -include, default toml file:
./build/linux/output/cppnamelint check --config cppnamelint.toml -include . simple.cpp

cppnamelint utility v0.3.4

File = simple.cpp
Config = cppnamelint.toml
Inc[ 1] = .
Checked = 2 [File:0 | Func: 1 | Param: 0 | Var: 1 | Enum: 0 | Struct: 0 | Union: 0 | Class: 0]
Error = 1 [File:0 | Func: 0 | Param: 0 | Var: 1 | Enum: 0 | Struct: 0 | Union: 0 | Class: 0]

< 5, 5> Variable : a_Test (BlaBla)

a_Test is detected correctly, but BlaBla itself and some_Var are not detected
so it looks like the header file is not really checked - is that correct?
thanks!

simple.zip

@ruedbi
Copy link
Author

ruedbi commented Jul 30, 2021

Hi @dougpuob,

could you please give the simple.zip from above a try? BTW: I'm on 4883fa3 now, using Ubuntu 18.04.

It very much looks like the simple.h is not included when clang tries to build the simple.cpp.
This could be a duplicate of your issue #52 , not sure.
When I inlude the declaration from the header file directly into the cpp file, I get one more finding (as expected):

cppnamelint utility v0.3.4

INFO : Log message will print to the file (y).

File = simple.cpp
Config = cppnamelint.toml
Checked = 3 [File:0 | Func: 1 | Param: 0 | Var: 2 | Enum: 0 | Struct: 0 | Union: 0 | Class: 1]
Error = 2 [File:0 | Func: 0 | Param: 0 | Var: 2 | Enum: 0 | Struct: 0 | Union: 0 | Class: 0]

< 6, 1> Variable : some_Var (int)
< 11, 5> Variable : a_Test (BlaBla)

The verbose output is (simple.cpp, with header file #included):
cppnamelint utility v0.3.4

clang version 12.0.0 (https://github.com/llvm/llvm-project.git 4918a3d138b907a571f496661b5367e090e1e8bb)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/ruedbi/projects/cppnamelint/build/linux/output
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.5.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Candidate multilib: .;@m64
Selected multilib: .;@m64
Found CUDA installation: /usr/local/cuda, version 10.0
clang Invocation:
"/home/ruedbi/projects/cppnamelint/build/linux/output/clang-tool" "-cc1" "-triple" "x86_64-unknown-linux-gnu" "-fsyntax-only" "-disable-free" "-disable-llvm-verifier" "-discard-value-names" "-main-file-name" "simple.cpp" "-mrelocation-model" "static" "-mframe-pointer=all" "-fmath-errno" "-fno-rounding-math" "-mconstructor-aliases" "-munwind-tables" "-target-cpu" "x86-64" "-tune-cpu" "generic" "-fno-split-dwarf-inlining" "-debugger-tuning=gdb" "-v" "-resource-dir" "/home/ruedbi/projects/cppnamelint/build/linux/lib/clang/12.0.0" "-I" "/home/ruedbi/projects/cppnamelint/." "-internal-isystem" "/usr/lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8" "-internal-isystem" "/usr/lib/gcc/x86_64-linux-gnu/8/../../../../include/x86_64-linux-gnu/c++/8" "-internal-isystem" "/usr/lib/gcc/x86_64-linux-gnu/8/../../../../include/x86_64-linux-gnu/c++/8" "-internal-isystem" "/usr/lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/backward" "-internal-isystem" "/usr/local/include" "-internal-isystem" "/home/ruedbi/projects/cppnamelint/build/linux/lib/clang/12.0.0/include" "-internal-externc-isystem" "/usr/include/x86_64-linux-gnu" "-internal-externc-isystem" "/include" "-internal-externc-isystem" "/usr/include" "-fdeprecated-macro" "-fdebug-compilation-dir" "/home/ruedbi/projects/cppnamelint" "-ferror-limit" "19" "-fgnuc-version=4.2.1" "-fcxx-exceptions" "-fexceptions" "-fcolor-diagnostics" "-faddrsig" "-x" "c++" "/home/ruedbi/projects/cppnamelint/simple.cpp"

clang -cc1 version 12.0.0 based upon LLVM 12.0.0 default target x86_64-unknown-linux-gnu
ignoring nonexistent directory "/home/ruedbi/projects/cppnamelint/build/linux/lib/clang/12.0.0/include"
ignoring nonexistent directory "/include"
ignoring duplicate directory "/usr/lib/gcc/x86_64-linux-gnu/8/../../../../include/x86_64-linux-gnu/c++/8"
#include "..." search starts here:
#include <...> search starts here:
/home/ruedbi/projects/cppnamelint/.
/usr/lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8
/usr/lib/gcc/x86_64-linux-gnu/8/../../../../include/x86_64-linux-gnu/c++/8
/usr/lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/backward
/usr/local/include
/usr/include/x86_64-linux-gnu
/usr/include
End of search list.
File = simple.cpp
Config = cppnamelint.toml
Inc[ 1] = .
Checked = 2 [File:0 | Func: 1 | Param: 0 | Var: 1 | Enum: 0 | Struct: 0 | Union: 0 | Class: 0]
Error = 1 [File:0 | Func: 0 | Param: 0 | Var: 1 | Enum: 0 | Struct: 0 | Union: 0 | Class: 0]

< 5, 5> Variable : a_Test (BlaBla)

and the log is

[2021-07-30 15:30:14.121] [] [info]
[2021-07-30 15:30:14.121] [] [info]
[2021-07-30 15:30:14.121] [] [info] =======================================================================================================================================================
[2021-07-30 15:30:14.121] [] [info] 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1
[2021-07-30 15:30:14.121] [] [info] 0123456789112345678921234567893123456789412345678951234567896123456789712345678981234567899123456789012345678911234567892123456789312345678941234567895
[2021-07-30 15:30:14.121] [] [info] =======================================================================================================================================================
[2021-07-30 15:30:14.121] [] [info] INFO : ContentStartsPosition = 55.
[2021-07-30 15:30:14.121] [] [info] INFO : Log message will print to the file (y).
[2021-07-30 15:30:14.121] [] [info] bCheckFileName = false
[2021-07-30 15:30:14.121] [] [info] bCheckFunctionName = true
[2021-07-30 15:30:14.121] [] [info] bCheckEnum = true
[2021-07-30 15:30:14.121] [] [info] bCheckStruct = true
[2021-07-30 15:30:14.121] [] [info] bCheckClass = true
[2021-07-30 15:30:14.121] [] [info] bCheckVariableName = true
[2021-07-30 15:30:14.121] [] [info] Source File = /home/ruedbi/projects/cppnamelint/simple.cpp
[2021-07-30 15:30:14.121] [] [info] Config File = cppnamelint.toml
[2021-07-30 15:30:14.121] [] [info] OutputJson =
[2021-07-30 15:30:14.121] [] [info] -I %s
[2021-07-30 15:30:14.121] [] [info] --language=c++
[2021-07-30 15:30:14.121] [] [info] Skipped, becuase config file is disable. (bCheckFileName)
[2021-07-30 15:30:14.128] [] [info] [MyASTVisitor] (==
[2021-07-30 15:30:14.128] [] [info] [MyASTVisitor] ==)
[2021-07-30 15:30:14.128] [] [info] [VisitFunctionDecl] (==
[2021-07-30 15:30:14.128] [] [info]
[2021-07-30 15:30:14.128] [] [info] V==start line====================================================================V
[2021-07-30 15:30:14.128] [] [info] ValueDecl.isWeak() = false
[2021-07-30 15:30:14.128] [] [info] FunctionDecl.getNameInfo() = main
[2021-07-30 15:30:14.128] [] [info] FunctionDecl.isDefined() = true
[2021-07-30 15:30:14.128] [] [info] FunctionDecl.isThisDeclarationADefinition() = true
[2021-07-30 15:30:14.128] [] [info] FunctionDecl.doesThisDeclarationHaveABody() = true
[2021-07-30 15:30:14.128] [] [info] FunctionDecl.isVariadic() = false
[2021-07-30 15:30:14.128] [] [info] FunctionDecl.isVirtualAsWritten() = false
[2021-07-30 15:30:14.128] [] [info] FunctionDecl.isPure() = false
[2021-07-30 15:30:14.128] [] [info] FunctionDecl.isDefaulted() = false
[2021-07-30 15:30:14.128] [] [info] FunctionDecl.hasPrototype() = true
[2021-07-30 15:30:14.128] [] [info] FunctionDecl.isMain() = true
[2021-07-30 15:30:14.128] [] [info] FunctionDecl.isExternC() = false
[2021-07-30 15:30:14.128] [] [info] FunctionDecl.isInExternCContext() = false
[2021-07-30 15:30:14.128] [] [info] FunctionDecl.isInExternCXXContext() = false
[2021-07-30 15:30:14.128] [] [info] FunctionDecl.isGlobal() = true
[2021-07-30 15:30:14.128] [] [info] FunctionDecl.isInlined() = false
[2021-07-30 15:30:14.128] [] [info] ----------------------------------------------------------------------------------
[2021-07-30 15:30:14.128] [] [info] NamedDecl.getNameAsString() = main
[2021-07-30 15:30:14.128] [] [info] NamedDecl.getDeclName() = main
[2021-07-30 15:30:14.128] [] [info] NamedDecl.getDeclKindName() = Function
[2021-07-30 15:30:14.128] [] [info] NamedDecl.getQualifiedNameAsString() = main
[2021-07-30 15:30:14.128] [] [info] NamedDecl.isCanonicalDecl() = true
[2021-07-30 15:30:14.128] [] [info] NamedDecl.isCXXClassMember() = false
[2021-07-30 15:30:14.128] [] [info] NamedDecl.isCXXInstanceMember() = false
[2021-07-30 15:30:14.128] [] [info] NamedDecl.isDefinedOutsideFunctionOrMethod() = true
[2021-07-30 15:30:14.128] [] [info] NamedDecl.isDeprecated() = false
[2021-07-30 15:30:14.128] [] [info] NamedDecl.isExternallyDeclarable() = true
[2021-07-30 15:30:14.128] [] [info] NamedDecl.isExternallyVisible() = true
[2021-07-30 15:30:14.128] [] [info] NamedDecl.isFirstDecl() = true
[2021-07-30 15:30:14.128] [] [info] NamedDecl.isFromASTFile() = false
[2021-07-30 15:30:14.128] [] [info] NamedDecl.isFunctionOrFunctionTemplate() = true
[2021-07-30 15:30:14.128] [] [info] NamedDecl.isImplicit() = false
[2021-07-30 15:30:14.128] [] [info] NamedDecl.isInAnonymousNamespace() = false
[2021-07-30 15:30:14.128] [] [info] NamedDecl.isInStdNamespace() = false
[2021-07-30 15:30:14.128] [] [info] NamedDecl.isInvalidDecl() = false
[2021-07-30 15:30:14.128] [] [info] NamedDecl.isLinkageValid() = true
[2021-07-30 15:30:14.128] [] [info] NamedDecl.isLocalExternDecl() = false
[2021-07-30 15:30:14.128] [] [info] NamedDecl.isModulePrivate() = false
[2021-07-30 15:30:14.128] [] [info] NamedDecl.isOutOfLine() = false
[2021-07-30 15:30:14.128] [] [info] NamedDecl.isParameterPack() = false
[2021-07-30 15:30:14.128] [] [info] NamedDecl.isReferenced() = false
[2021-07-30 15:30:14.128] [] [info] NamedDecl.isTemplated() = false
[2021-07-30 15:30:14.128] [] [info] NamedDecl.isTemplateDecl() = false
[2021-07-30 15:30:14.128] [] [info] NamedDecl.isTemplateParameter() = false
[2021-07-30 15:30:14.128] [] [info] NamedDecl.isTemplateParameterPack() = false
[2021-07-30 15:30:14.128] [] [info] NamedDecl.isThisDeclarationReferenced() = false
[2021-07-30 15:30:14.128] [] [info] NamedDecl.isTopLevelDeclInObjCContainer() = false
[2021-07-30 15:30:14.128] [] [info] NamedDecl.isUnavailable() = false
[2021-07-30 15:30:14.128] [] [info] NamedDecl.isUsed() = false
[2021-07-30 15:30:14.128] [] [info] NamedDecl.isWeakImported() = false
[2021-07-30 15:30:14.128] [] [info] ^==end line=======================================================================^
[2021-07-30 15:30:14.128] [] [info] [VisitFunctionDecl] ==)
[2021-07-30 15:30:14.128] [] [info] [VisitFunctionTypeLoc] (==
[2021-07-30 15:30:14.128] [] [info] [VisitFunctionTypeLoc] ==)
[2021-07-30 15:30:14.128] [] [info] [VisitVarDecl] (==
[2021-07-30 15:30:14.128] [] [info]
[2021-07-30 15:30:14.128] [] [info] V==start line====================================================================V
[2021-07-30 15:30:14.128] [] [info] ValueDecl.isWeak() = false
[2021-07-30 15:30:14.128] [] [info] VarDecl.isExternC() = false
[2021-07-30 15:30:14.128] [] [info] VarDecl.isInExternCContext() = false
[2021-07-30 15:30:14.128] [] [info] VarDecl.isInExternCXXContext() = false
[2021-07-30 15:30:14.128] [] [info] VarDecl.isLocalVarDecl() = true
[2021-07-30 15:30:14.128] [] [info] VarDecl.isLocalVarDeclOrParm() = true
[2021-07-30 15:30:14.128] [] [info] VarDecl.isFunctionOrMethodVarDecl() = true
[2021-07-30 15:30:14.128] [] [info] VarDecl.isStaticDataMember() = false
[2021-07-30 15:30:14.128] [] [info] VarDecl.isFileVarDecl() = false
[2021-07-30 15:30:14.128] [] [info] VarDecl.hasInit() = true
[2021-07-30 15:30:14.128] [] [info] ----------------------------------------------------------------------------------
[2021-07-30 15:30:14.128] [] [info] NamedDecl.getNameAsString() = a_Test
[2021-07-30 15:30:14.129] [] [info] NamedDecl.getDeclName() = a_Test
[2021-07-30 15:30:14.129] [] [info] NamedDecl.getDeclKindName() = Var
[2021-07-30 15:30:14.129] [] [info] NamedDecl.getQualifiedNameAsString() = a_Test
[2021-07-30 15:30:14.129] [] [info] NamedDecl.isCanonicalDecl() = true
[2021-07-30 15:30:14.129] [] [info] NamedDecl.isCXXClassMember() = false
[2021-07-30 15:30:14.129] [] [info] NamedDecl.isCXXInstanceMember() = false
[2021-07-30 15:30:14.129] [] [info] NamedDecl.isDefinedOutsideFunctionOrMethod() = false
[2021-07-30 15:30:14.129] [] [info] NamedDecl.isDeprecated() = false
[2021-07-30 15:30:14.129] [] [info] NamedDecl.isExternallyDeclarable() = false
[2021-07-30 15:30:14.129] [] [info] NamedDecl.isExternallyVisible() = false
[2021-07-30 15:30:14.129] [] [info] NamedDecl.isFirstDecl() = true
[2021-07-30 15:30:14.129] [] [info] NamedDecl.isFromASTFile() = false
[2021-07-30 15:30:14.129] [] [info] NamedDecl.isFunctionOrFunctionTemplate() = false
[2021-07-30 15:30:14.129] [] [info] NamedDecl.isImplicit() = false
[2021-07-30 15:30:14.129] [] [info] NamedDecl.isInAnonymousNamespace() = false
[2021-07-30 15:30:14.129] [] [info] NamedDecl.isInStdNamespace() = false
[2021-07-30 15:30:14.129] [] [info] NamedDecl.isInvalidDecl() = false
[2021-07-30 15:30:14.129] [] [info] NamedDecl.isLinkageValid() = true
[2021-07-30 15:30:14.129] [] [info] NamedDecl.isLocalExternDecl() = false
[2021-07-30 15:30:14.129] [] [info] NamedDecl.isModulePrivate() = false
[2021-07-30 15:30:14.129] [] [info] NamedDecl.isOutOfLine() = false
[2021-07-30 15:30:14.129] [] [info] NamedDecl.isParameterPack() = false
[2021-07-30 15:30:14.129] [] [info] NamedDecl.isReferenced() = true
[2021-07-30 15:30:14.129] [] [info] NamedDecl.isTemplated() = false
[2021-07-30 15:30:14.129] [] [info] NamedDecl.isTemplateDecl() = false
[2021-07-30 15:30:14.129] [] [info] NamedDecl.isTemplateParameter() = false
[2021-07-30 15:30:14.129] [] [info] NamedDecl.isTemplateParameterPack() = false
[2021-07-30 15:30:14.129] [] [info] NamedDecl.isThisDeclarationReferenced() = true
[2021-07-30 15:30:14.129] [] [info] NamedDecl.isTopLevelDeclInObjCContainer() = false
[2021-07-30 15:30:14.129] [] [info] NamedDecl.isUnavailable() = false
[2021-07-30 15:30:14.129] [] [info] NamedDecl.isUsed() = true
[2021-07-30 15:30:14.129] [] [info] NamedDecl.isWeakImported() = false
[2021-07-30 15:30:14.129] [] [info] ^==end line=======================================================================^
[2021-07-30 15:30:14.129] [] [info] [VisitVarDecl] ==)
[2021-07-30 15:30:14.129] [] [info] [VisitTagTypeLoc] (==
[2021-07-30 15:30:14.129] [] [info] [VisitTagTypeLoc] ==)
[2021-07-30 15:30:14.129] [] [info] [VisitReturnStmt] (==
[2021-07-30 15:30:14.129] [] [info] MyQualType.getAsString() = int
[2021-07-30 15:30:14.129] [] [info] [VisitReturnStmt] ==)
[2021-07-30 15:30:14.129] [] [info] Inc[ 1] = .
[2021-07-30 15:30:14.129] [] [info] Checked = 2 [File:0 | Func: 1 | Param: 0 | Var: 1 | Enum: 0 | Struct: 0 | Union: 0 | Class: 0]
[2021-07-30 15:30:14.129] [] [info] Error = 1 [File:0 | Func: 0 | Param: 0 | Var: 1 | Enum: 0 | Struct: 0 | Union: 0 | Class: 0]
[2021-07-30 15:30:14.129] [] [info] ------------------------------------------------------------
[2021-07-30 15:30:14.129] [] [info] < 5, 5> Variable : a_Test (BlaBla)
[2021-07-30 15:30:14.131] [] [info] Assert.nErrorOccurred = 0
[2021-07-30 15:30:14.131] [] [info] Assert.nInvalidDecl = 0
[2021-07-30 15:30:14.131] [] [info] Assert.nNumWarnings = 0
[2021-07-30 15:30:14.131] [] [info] Checked.nClass = 0
[2021-07-30 15:30:14.131] [] [info] Checked.nEnum = 0
[2021-07-30 15:30:14.131] [] [info] Checked.nFile = 0
[2021-07-30 15:30:14.131] [] [info] Checked.nFunction = 1
[2021-07-30 15:30:14.131] [] [info] Checked.nParameter = 0
[2021-07-30 15:30:14.131] [] [info] Checked.nStruct = 0
[2021-07-30 15:30:14.131] [] [info] Checked.nUnion = 0
[2021-07-30 15:30:14.131] [] [info] Checked.nVariable = 1
[2021-07-30 15:30:14.131] [] [info] Error.nClass = 0
[2021-07-30 15:30:14.131] [] [info] Error.nEnum = 0
[2021-07-30 15:30:14.131] [] [info] Error.nFile = 0
[2021-07-30 15:30:14.131] [] [info] Error.nFunction = 0
[2021-07-30 15:30:14.131] [] [info] Error.nParameter = 0
[2021-07-30 15:30:14.131] [] [info] Error.nStruct = 0
[2021-07-30 15:30:14.131] [] [info] Error.nUnion = 0
[2021-07-30 15:30:14.131] [] [info] Error.nVariable = 1
[2021-07-30 15:30:14.131] [] [info] Program is going to close. (iRet=1)

Thanks!

@dougpuob
Copy link
Owner

Hi @ruedbi
Reply your questions.

  1. finding with --verbose:
    Please reference to the block. (https://github.com/dougpuob/cppnamelint/blob/master/source/Common.cpp#L87)

  2. Is it expected to check .h files explicitly, or should they only be checked implicitly when included from a .cpp file?
    Please reference to block (https://github.com/dougpuob/cppnamelint/blob/master/source/Common.cpp#L110)
    Use --language=c++ option.

  3. a_Test is detected correctly, but BlaBla...
    This is an issue I tried to fix but I forget updating it the trunk on another PC. I will tag you if done later.


Sorry to reply you late, next time you can ping me directly. And if possible could you please file issues one by one making it clear. You did nice to this project and must hard to test and compare it with clang, thank you. Issues that you have ideas to fix or improve, PR is also welcome.

Another information about this project, I am still trying to migrate features to clang-tidy too, at that time this project will be archived.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants