cppclean icon indicating copy to clipboard operation
cppclean copied to clipboard

False positive when includes are not together in the .cpp file.

Open ghost opened this issue 6 years ago • 1 comments

If the includes are not bunched together in the code, cppclean fails to identify some includes that are present and raises a warning.

Example:


#include "file.h"
#include <algorithm>

#include "file2.h"
#include "file3.h"

Error: file.cc: should #include header file 'file.h'

ghost avatar Sep 25 '19 13:09 ghost

Same problem here.

With this example:

D:
└───testlib
    └───src
        └───testlib
            └───test.cpp
            └───test.h

test.h:

#pragma once

void Test();

test.cpp:

#include "testlib/test.h"

void Test()
{
	
}

If I run python "C:/Program Files/Python39/Scripts/cppclean" --include-path-non-system="D:/testlib/src" . from the src folder, I get the following result:

.\testlib\test.cpp: should #include header file '.\testlib\test.h'

Cyphall avatar Jul 31 '22 12:07 Cyphall