Skip to content

Commit d5967f4

Browse files
committed
fix the .precommit ci file, format code & fix AppVoyer
1 parent 39e6e98 commit d5967f4

294 files changed

Lines changed: 26437 additions & 21209 deletions

File tree

Some content is hidden

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

.clang-format

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
BasedOnStyle: LLVM
2+
IndentWidth: 4
3+
TabWidth: 4
4+
UseTab: Never
5+
BreakBeforeBraces: Allman
6+
BraceWrapping:
7+
AfterClass: true
8+
AfterNamespace: true
9+
AfterFunction: true
10+
AfterControlStatement: true
11+
BeforeElse: true
12+
IndentBraces: false
13+
AccessModifierOffset: -2
14+
IndentAccessModifiers: false
15+
IncludeBlocks: Preserve
16+
SortIncludes: false
17+
AlignConsecutiveAssignments: true
18+
AlignConsecutiveDeclarations: true
19+
AlignTrailingComments: true
20+
NamespaceIndentation: All
21+
ColumnLimit: 100
22+
PointerAlignment: Left
23+
ReferenceAlignment: Left
24+
Cpp11BracedListStyle: false
25+
AllowShortFunctionsOnASingleLine: None
26+
AllowShortIfStatementsOnASingleLine: false
27+
AllowShortLoopsOnASingleLine: false

.github/workflows/cmake.yaml

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,23 @@ jobs:
55
strategy:
66
fail-fast: false
77
matrix:
8-
include:
9-
- os: windows-latest
10-
preset: windows-ci
11-
- os: ubuntu-latest
12-
preset: linux-ci
13-
- os: ubuntu-latest
14-
preset: linux-ci
15-
- os: macos-latest
16-
preset: macos-ci
8+
os: [windows-2022, windows-2019]
9+
platform: [x64, Win32]
10+
configuration: [Debug, Release]
1711
runs-on: ${{ matrix.os }}
1812
timeout-minutes: 120
1913
steps:
20-
- uses: actions/checkout@v4
14+
- uses: actions/checkout@v4
15+
- name: Configure CMake
16+
shell: powershell
17+
run: |
18+
if (${{ matrix.os }} -eq 'windows-2022') {
19+
$generator = 'Visual Studio 17 2022'
20+
} else {
21+
$generator = 'Visual Studio 16 2019'
22+
}
23+
cmake -G "$generator" -A "${{ matrix.platform }}" -DCMAKE_TOOLCHAIN_FILE=C:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake -S . -B build/${{ matrix.os }}-${{ matrix.platform }}-${{ matrix.configuration }}
24+
- name: Build
25+
shell: powershell
26+
run: |
27+
cmake --build build/${{ matrix.os }}-${{ matrix.platform }}-${{ matrix.configuration }} --config ${{ matrix.configuration }}

.github/workflows/continuous-integration-workflow.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.

CMakeSettings.json

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
1-
{
2-
"configurations": [
3-
{
4-
"buildRoot": "${projectDir}\\build\\${name}",
5-
"cmakeCommandArgs": "",
6-
"cmakeGeneratorPlatform": "x64",
7-
"cmakeToolchain": "C:/Program Files/Microsoft Visual Studio/18/Community/VC/vcpkg/scripts/buildsystems/vcpkg.cmake",
8-
"configurationType": "Debug",
9-
"ctestCommandArgs": "",
10-
"inheritEnvironments": [ "msvc_x64" ],
11-
"generator": "Visual Studio 17 2022",
12-
"installRoot": "${projectDir}\\build\\install\\${name}",
13-
"name": "x64-Debug",
14-
"buildCommandArgs": ""
15-
}
16-
]
1+
2+
{
3+
"configurations": [
4+
{
5+
"buildRoot": "${projectDir}\\build\\${name}",
6+
"cmakeCommandArgs": "",
7+
"cmakeGeneratorPlatform": "x64",
8+
"cmakeToolchain":
9+
"C:/Program Files/Microsoft Visual Studio/18/Community/VC/vcpkg/scripts/buildsystems/vcpkg.cmake",
10+
"configurationType": "Debug",
11+
"ctestCommandArgs": "",
12+
"inheritEnvironments": [
13+
"msvc_x64"
14+
],
15+
"generator": "Visual Studio 17 2022",
16+
"installRoot": "${projectDir}\\build\\install\\${name}",
17+
"name": "x64-Debug",
18+
"buildCommandArgs": ""
19+
}
20+
]
1721
}

Common/CommonExport.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,4 @@
2424
#define VCOV_COMMONEXPORT_DLL __declspec(dllimport)
2525
#endif
2626

27-
#pragma warning (disable: 4251)
28-
29-
30-
27+
#pragma warning(disable : 4251)

Common/ExceptionBase.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,22 @@
1414
// You should have received a copy of the GNU General Public License
1515
// along with this program. If not, see <http://www.gnu.org/licenses/>.
1616

17-
#include "stdafx.h"
1817
#include "ExceptionBase.hpp"
1918
#include "Tool.hpp"
19+
#include "stdafx.h"
2020
#include <filesystem>
2121

2222
namespace Tools
2323
{
24-
//-------------------------------------------------------------------------
25-
ExceptionBase::ExceptionBase(const std::wstring& message)
26-
: std::exception(ToLocalString(message).c_str())
27-
{
28-
}
24+
//-------------------------------------------------------------------------
25+
ExceptionBase::ExceptionBase(const std::wstring& message)
26+
: std::exception(ToLocalString(message).c_str())
27+
{
28+
}
2929

30-
//-------------------------------------------------------------------------
31-
std::wstring GetFilename(const char* path)
32-
{
33-
return std::filesystem::path{ path }.filename().wstring();
34-
}
35-
}
30+
//-------------------------------------------------------------------------
31+
std::wstring GetFilename(const char* path)
32+
{
33+
return std::filesystem::path{ path }.filename().wstring();
34+
}
35+
} // namespace Tools

Common/ExceptionBase.hpp

Lines changed: 30 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -16,46 +16,45 @@
1616

1717
#pragma once
1818

19+
#include "CommonExport.h"
1920
#include <exception>
20-
#include <string>
2121
#include <sstream>
22-
#include "CommonExport.h"
22+
#include <string>
2323

2424
#pragma warning(push)
25-
//#pragma warning(disable: 4275) // warning C4275: non dll-interface class 'std::exception' used as base for dll-interface class
25+
// #pragma warning(disable: 4275) // warning C4275: non dll-interface class
26+
// 'std::exception' used as base for dll-interface class
2627

2728
namespace Tools
2829
{
2930

30-
class VCOV_COMMONEXPORT_DLL ExceptionBase : public std::exception
31-
{
32-
protected:
33-
ExceptionBase(const std::wstring& message);
34-
};
31+
class VCOV_COMMONEXPORT_DLL ExceptionBase : public std::exception
32+
{
33+
protected:
34+
ExceptionBase(const std::wstring& message);
35+
};
3536

36-
VCOV_COMMONEXPORT_DLL std::wstring GetFilename(const char*);
37-
}
37+
VCOV_COMMONEXPORT_DLL std::wstring GetFilename(const char*);
38+
} // namespace Tools
3839

3940
#pragma warning(pop)
4041

41-
#define GENERATE_EXCEPTION_CLASS(namespaceName, exceptionName) \
42-
namespace namespaceName \
43-
{ \
44-
class exceptionName : public Tools::ExceptionBase \
45-
{ \
46-
public: \
47-
explicit exceptionName(const std::wstring& message) \
48-
: ExceptionBase(message) \
49-
{ \
50-
} \
51-
}; \
52-
}
53-
54-
#define THROW_BASE(namespaceName, className, message) \
55-
do \
56-
{ \
57-
std::wostringstream ostr; \
58-
ostr << Tools::GetFilename(__FILE__) << ':' << __LINE__ << ' ' \
59-
<< message; \
60-
throw namespaceName::className(ostr.str()); \
61-
} while (false)
42+
#define GENERATE_EXCEPTION_CLASS(namespaceName, exceptionName) \
43+
namespace namespaceName \
44+
{ \
45+
class exceptionName : public Tools::ExceptionBase \
46+
{ \
47+
public: \
48+
explicit exceptionName(const std::wstring& message) : ExceptionBase(message) \
49+
{ \
50+
} \
51+
}; \
52+
}
53+
54+
#define THROW_BASE(namespaceName, className, message) \
55+
do \
56+
{ \
57+
std::wostringstream ostr; \
58+
ostr << Tools::GetFilename(__FILE__) << ':' << __LINE__ << ' ' << message; \
59+
throw namespaceName::className(ostr.str()); \
60+
} while (false)

Common/FileSystem.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,20 @@
1414
// You should have received a copy of the GNU General Public License
1515
// along with this program. If not, see <http://www.gnu.org/licenses/>.
1616

17-
#include "stdafx.h"
18-
#include <system_error>
1917
#include "FileSystem.hpp"
18+
#include "stdafx.h"
2019
#include <boost/optional/optional.hpp>
20+
#include <system_error>
2121

2222
namespace CppCoverage
2323
{
24-
//----------------------------------------------------------------------------
25-
boost::optional<std::filesystem::file_time_type>
26-
FileSystem::GetLastWriteTime(const std::filesystem::path& path) const
27-
{
28-
std::error_code error;
29-
auto time = std::filesystem::last_write_time(path, error);
24+
//----------------------------------------------------------------------------
25+
boost::optional<std::filesystem::file_time_type>
26+
FileSystem::GetLastWriteTime(const std::filesystem::path& path) const
27+
{
28+
std::error_code error;
29+
auto time = std::filesystem::last_write_time(path, error);
3030

31-
return error ? boost::optional<std::filesystem::file_time_type>{} : time;
32-
}
33-
}
31+
return error ? boost::optional<std::filesystem::file_time_type>{} : time;
32+
}
33+
} // namespace CppCoverage

Common/FileSystem.hpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@
1616

1717
#pragma once
1818

19-
#include "IFileSystem.hpp"
2019
#include "CommonExport.h"
20+
#include "IFileSystem.hpp"
2121

2222
namespace CppCoverage
2323
{
24-
class VCOV_COMMONEXPORT_DLL FileSystem : public IFileSystem
25-
{
26-
public:
27-
boost::optional<std::filesystem::file_time_type>
28-
GetLastWriteTime(const std::filesystem::path&) const override;
29-
};
30-
}
24+
class VCOV_COMMONEXPORT_DLL FileSystem : public IFileSystem
25+
{
26+
public:
27+
boost::optional<std::filesystem::file_time_type>
28+
GetLastWriteTime(const std::filesystem::path&) const override;
29+
};
30+
} // namespace CppCoverage

0 commit comments

Comments
 (0)