Skip to content

Commit 77e3917

Browse files
committed
Public version 0.3.1
1 parent 89bc707 commit 77e3917

File tree

315 files changed

+3386
-3034
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

315 files changed

+3386
-3034
lines changed

.clang-format

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
AccessModifierOffset: '-4'
3+
AlignAfterOpenBracket: AlwaysBreak
4+
AlignConsecutiveMacros: 'true'
5+
AlignEscapedNewlines: Left
6+
AlignTrailingComments: 'true'
7+
AllowAllArgumentsOnNextLine: 'false'
8+
AllowAllParametersOfDeclarationOnNextLine: 'true'
9+
AllowShortBlocksOnASingleLine: 'false'
10+
AllowShortCaseLabelsOnASingleLine: 'false'
11+
AllowShortFunctionsOnASingleLine: None
12+
AllowShortIfStatementsOnASingleLine: Never
13+
AllowShortLoopsOnASingleLine: 'false'
14+
AlwaysBreakAfterDefinitionReturnType: None
15+
AlwaysBreakAfterReturnType: None
16+
BinPackParameters: 'false'
17+
BreakBeforeBraces: Allman
18+
BreakConstructorInitializers: BeforeComma
19+
BreakInheritanceList: BeforeComma
20+
CompactNamespaces: 'false'
21+
ExperimentalAutoDetectBinPacking: 'false'
22+
FixNamespaceComments: 'false'
23+
IndentCaseLabels: 'true'
24+
IndentPPDirectives: BeforeHash
25+
IndentWidth: '4'
26+
KeepEmptyLinesAtTheStartOfBlocks: 'false'
27+
Language: Cpp
28+
MaxEmptyLinesToKeep: '1'
29+
PointerAlignment: Middle
30+
SortUsingDeclarations: 'true'
31+
SpaceAfterCStyleCast: 'false'
32+
SpaceAfterLogicalNot: 'false'
33+
SpaceAfterTemplateKeyword: 'false'
34+
SpaceBeforeAssignmentOperators: 'true'
35+
SpaceBeforeCpp11BracedList: 'false'
36+
SpaceBeforeInheritanceColon: 'true'
37+
SpaceBeforeParens: Never
38+
SpaceBeforeRangeBasedForLoopColon: 'false'
39+
SpaceInEmptyParentheses: 'false'
40+
SpacesInAngles: 'true'
41+
SpacesInCStyleCastParentheses: 'true'
42+
SpacesInContainerLiterals: 'true'
43+
SpacesInParentheses: 'true'
44+
SpacesInSquareBrackets: 'false'
45+
Standard: Cpp11
46+
TabWidth: '4'
47+
UseTab: Always
48+
49+
...

.clang-tidy

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
AccessModifierOffset: '-4'
3+
AlignAfterOpenBracket: AlwaysBreak
4+
AlignConsecutiveMacros: 'true'
5+
AlignEscapedNewlines: Left
6+
AlignTrailingComments: 'true'
7+
AllowAllArgumentsOnNextLine: 'false'
8+
AllowAllParametersOfDeclarationOnNextLine: 'true'
9+
AllowShortBlocksOnASingleLine: 'false'
10+
AllowShortCaseLabelsOnASingleLine: 'false'
11+
AllowShortFunctionsOnASingleLine: None
12+
AllowShortIfStatementsOnASingleLine: Never
13+
AllowShortLoopsOnASingleLine: 'false'
14+
AlwaysBreakAfterDefinitionReturnType: None
15+
AlwaysBreakAfterReturnType: None
16+
BinPackParameters: 'false'
17+
BreakBeforeBraces: Allman
18+
BreakConstructorInitializers: BeforeComma
19+
BreakInheritanceList: BeforeComma
20+
CompactNamespaces: 'false'
21+
ExperimentalAutoDetectBinPacking: 'false'
22+
FixNamespaceComments: 'false'
23+
IndentCaseLabels: 'true'
24+
IndentPPDirectives: BeforeHash
25+
IndentWidth: '4'
26+
KeepEmptyLinesAtTheStartOfBlocks: 'false'
27+
Language: Cpp
28+
MaxEmptyLinesToKeep: '1'
29+
PointerAlignment: Middle
30+
SortUsingDeclarations: 'true'
31+
SpaceAfterCStyleCast: 'false'
32+
SpaceAfterLogicalNot: 'false'
33+
SpaceAfterTemplateKeyword: 'false'
34+
SpaceBeforeAssignmentOperators: 'true'
35+
SpaceBeforeCpp11BracedList: 'false'
36+
SpaceBeforeInheritanceColon: 'true'
37+
SpaceBeforeParens: Never
38+
SpaceBeforeRangeBasedForLoopColon: 'false'
39+
SpaceInEmptyParentheses: 'false'
40+
SpacesInAngles: 'true'
41+
SpacesInCStyleCastParentheses: 'true'
42+
SpacesInContainerLiterals: 'true'
43+
SpacesInParentheses: 'true'
44+
SpacesInSquareBrackets: 'false'
45+
Standard: Cpp11
46+
TabWidth: '4'
47+
UseTab: Always
48+
49+
...

.cspell.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222
"ccomplex",
2323
"stdfs",
2424
"cmake",
25-
"unincluded"
25+
"unincluded",
26+
"NOLINTNEXTLINE",
27+
"hicpp",
28+
"NOLINT",
29+
"clazy"
2630
],
2731
}

.gitlab-ci.yml

Lines changed: 35 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,21 @@ build_gcc10:
1111
# Build with boost
1212
- apt-get install libboost-test-dev -y
1313
- cd build
14-
- cmake ../src/ -DCMAKE_BUILD_TYPE=Release -DCPPINCLUDE_BUILD_WITH_TESTS=ON
14+
- cmake .. -DCMAKE_BUILD_TYPE=Release -DCPPINCLUDE_BUILD_WITH_TESTS=ON
15+
- cmake --build . --config Release
16+
# Run tests
17+
- ctest . -C Release
18+
19+
build_gcc8:
20+
stage: build
21+
image: ubuntu
22+
script:
23+
- apt-get update
24+
- apt-get install cmake gcc-8 g++-8 libboost-test-dev -y
25+
- export CC=gcc-8
26+
- export CXX=g++-8
27+
- cd build
28+
- cmake .. -DCMAKE_BUILD_TYPE=Release -DCPPINCLUDE_BUILD_WITH_TESTS=ON
1529
- cmake --build . --config Release
1630
# Run tests
1731
- ctest . -C Release
@@ -21,15 +35,11 @@ build_gcc7:
2135
image: ubuntu
2236
script:
2337
- apt-get update
24-
- apt-get install cmake gcc-7 g++-7 -y
38+
- apt-get install cmake gcc-7 g++-7 libboost-test-dev -y
2539
- export CC=gcc-7
2640
- export CXX=g++-7
27-
# Build without boost
28-
- ./build.sh
29-
# Build with boost
30-
- apt-get install libboost-test-dev -y
3141
- cd build
32-
- cmake ../src/ -DCMAKE_BUILD_TYPE=Release -DCPPINCLUDE_BUILD_WITH_TESTS=ON
42+
- cmake .. -DCMAKE_BUILD_TYPE=Release -DCPPINCLUDE_BUILD_WITH_TESTS=ON
3343
- cmake --build . --config Release
3444
# Run tests
3545
- ctest . -C Release
@@ -39,15 +49,11 @@ build_clang:
3949
image: ubuntu
4050
script:
4151
- apt-get update
42-
- apt-get install cmake clang -y
52+
- apt-get install cmake clang libboost-test-dev -y
4353
- export CC=/usr/bin/clang
4454
- export CXX=/usr/bin/clang++
45-
# Build without boost
46-
- ./build.sh
47-
# Build with boost
48-
- apt-get install libboost-test-dev -y
4955
- cd build
50-
- cmake ../src/ -DCMAKE_BUILD_TYPE=Release -DCPPINCLUDE_BUILD_WITH_TESTS=ON
56+
- cmake .. -DCMAKE_BUILD_TYPE=Release -DCPPINCLUDE_BUILD_WITH_TESTS=ON
5157
- cmake --build . --config Release
5258
# Run tests
5359
- ctest . -C Release
@@ -68,7 +74,7 @@ build_windows:
6874
# Build with boost
6975
#- vcpkg install boost-test:x64-windows
7076
#- vcpkg install boost-system:x64-windows
71-
- cmake ../src/ -G "Visual Studio 16" -DCMAKE_BUILD_TYPE=Release -DCPPINCLUDE_BUILD_WITH_TESTS=ON -DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake
77+
- cmake .. -G "Visual Studio 16" -DCMAKE_BUILD_TYPE=Release -DCPPINCLUDE_BUILD_WITH_TESTS=ON -DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake
7278
- cmake --build . --config Release
7379
# Run tests
7480
- ctest . -C Release
@@ -83,7 +89,7 @@ build_vs2017:
8389
#- choco install cmake -y
8490
- $env:PATH="C:\Program Files\CMake\bin;$env:PATH"
8591
- cd build
86-
- cmake -G "Visual Studio 15" ../src/ -DCMAKE_BUILD_TYPE=Release
92+
- cmake -G "Visual Studio 15" .. -DCMAKE_BUILD_TYPE=Release
8793
- cmake --build . --config Release
8894

8995
build_macos:
@@ -96,11 +102,22 @@ build_macos:
96102
# Build with boost
97103
# brew install boost
98104
- cd build
99-
- cmake ../src/ -DCMAKE_BUILD_TYPE=Release -DCPPINCLUDE_BUILD_WITH_TESTS=ON
105+
- cmake .. -DCMAKE_BUILD_TYPE=Release -DCPPINCLUDE_BUILD_WITH_TESTS=ON
100106
- cmake --build . --config Release
101107
# Run tests
102108
- ctest . -C Release
103109

110+
build_arm_linux:
111+
stage: build
112+
tags:
113+
- arm-linux
114+
script:
115+
- cd build
116+
- cmake .. -DCMAKE_BUILD_TYPE=Release -DCPPINCLUDE_BUILD_WITH_TESTS=ON
117+
- cmake --build . --config Release -j4
118+
# Run tests
119+
- ctest . -C Release
120+
104121
check_typos:
105122
stage: build
106123
image: ubuntu
@@ -119,9 +136,8 @@ cppcheck:
119136
image: ubuntu
120137
script:
121138
- apt-get update
122-
- apt-get install cmake gcc g++ libboost-test-dev -y
123-
- apt-get install cppcheck -y
139+
- apt-get install cmake gcc g++ libboost-test-dev cppcheck -y
124140
- cd build
125-
- cmake ../src/ -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCPPINCLUDE_BUILD_WITH_TESTS=ON
141+
- cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCPPINCLUDE_BUILD_WITH_TESTS=ON
126142
- cppcheck --project=compile_commands.json --enable=all --suppressions-list=../.cppcheck-suppressions-list --error-exitcode=1 --quiet
127143

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## [v0.3.1](docs/versions/VERSION_0.3.1.md)
4+
5+
### Fixed (v0.3.1)
6+
7+
* Fixed detect file name after comments /**/ in include
8+
39
## [v0.3.0](docs/versions/VERSION_0.3.0.md)
410

511
### Added (v0.3.0)

CMakeLists.txt

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
cmake_minimum_required(VERSION 3.10)
2+
3+
project(cppinclude)
4+
5+
include_directories(src/)
6+
include_directories(src/3rd-part/fmt/include/)
7+
include_directories(src/3rd-part/cpp-std-fwd/)
8+
include_directories(src/3rd-part/std_fs/include)
9+
10+
set(CMAKE_CXX_STANDARD 17)
11+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
12+
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_CURRENT_SOURCE_DIR}/src/cmake")
13+
14+
if(CMAKE_COMPILER_IS_GNUCC)
15+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-unused-function")
16+
endif()
17+
if(MSVC)
18+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
19+
endif()
20+
21+
option(CPPINCLUDE_BUILD_WITH_TESTS "Build with tests")
22+
option(CPPINCLUDE_BUILD_WITH_CLANG_TIDY "Build with clang-tidy")
23+
24+
if(CPPINCLUDE_BUILD_WITH_CLANG_TIDY)
25+
set(CMAKE_CXX_CLANG_TIDY "clang-tidy")
26+
endif()
27+
28+
file(GLOB all_sources "src/*.cpp")
29+
add_executable(${PROJECT_NAME} ${all_sources})
30+
31+
if(CPPINCLUDE_BUILD_WITH_TESTS)
32+
set(BOOST_LIBRARYDIR "/usr/lib/x86_64-linux-gnu/" )
33+
enable_testing()
34+
add_subdirectory(src/test_tools)
35+
endif()
36+
37+
if(MSVC)
38+
if(NOT CPPINCLUDE_BUILD_WITH_TESTS)
39+
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
40+
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
41+
endif()
42+
add_compile_options(/W3 /WX)
43+
endif()
44+
45+
macro(TARGET_SPECIFIC targetName)
46+
if(CMAKE_COMPILER_IS_GNUCXX)
47+
target_link_libraries(${targetName} stdc++fs)
48+
endif()
49+
endmacro()
50+
51+
add_subdirectory(src/parser)
52+
add_subdirectory(src/fs)
53+
add_subdirectory(src/model_includes)
54+
add_subdirectory(src/reporter)
55+
add_subdirectory(src/tools)
56+
add_subdirectory(src/project)
57+
add_subdirectory(src/application)
58+
add_subdirectory(src/3rd-part/fmt)
59+
add_subdirectory(src/json)
60+
add_subdirectory(src/compilation_db)
61+
add_subdirectory(src/cmake_project)
62+
63+
target_link_libraries(${PROJECT_NAME} application_lib)
64+
65+
if(MSVC)
66+
set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "/INCREMENTAL:NO")
67+
endif()
68+

build.bat

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
cd build
1+
set buildDir=build
2+
IF not exist %buildDir% (mkdir %buildDir%)
23

3-
cmake ..\src\ -DCMAKE_BUILD_TYPE=Release && cmake --build . --config Release
4+
cd %buildDir%
5+
6+
cmake .. -DCMAKE_BUILD_TYPE=Release && cmake --build . --config Release
47

58
cd ..
69
copy build\Release\cppinclude.exe cppinclude.exe && echo "File cppinclude.exe compiled"

build.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
mkdir -p build
2+
13
cd build
24

3-
cmake ../src/ -DCMAKE_BUILD_TYPE=Release && \
5+
cmake .. -DCMAKE_BUILD_TYPE=Release && \
46
cmake --build . --config Release
57

68
cd -

check_code_style.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
tempDir=${TMPDIR:-/tmp}/cppinclude
2+
3+
echo "Prepare sources..."
4+
[[ -d $tempDir ]] && rm -r $tempDir
5+
mkdir -p $tempDir && echo "Created new folder $tempDir"
6+
7+
cp .clang-tidy $tempDir && echo "Copied .clang-tidy"
8+
cp -r ./src $tempDir && echo "Copied src folder"
9+
10+
echo "Run clang-format..."
11+
find $tempDir -regex '.*\.\(cpp\|hpp\)' ! -path '$tempDir/src/3rd-part/**' -exec clang-format -style=file -i {} \;
12+
13+
echo "Run meld..."
14+
meld $tempDir/src ./src

0 commit comments

Comments
 (0)