Skip to content

Commit f402660

Browse files
authored
Align formatting with incoming support for Clang-Format (#400)
* Sorting of includes and special case handling of preprocessor macros * Lots of minor formatting ammendmends * Further formattings * Further prepratory formatting
1 parent a7f6970 commit f402660

66 files changed

Lines changed: 230 additions & 225 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.

libraries/application/src/morpheus/application/application.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ namespace morpheus::application
1515
///
1616
///
1717
// template<typename T>
18-
class Application {
18+
class Application
19+
{
1920
public:
2021
///
2122
/// \param[in] argc The number of command line arguments.
@@ -34,7 +35,7 @@ class Application {
3435
}
3536

3637
private:
37-
po::Config mConfig; /// Common application configuration
38+
po::Config mConfig; /// Common application configuration
3839
std::filesystem::path mLogPath; /// Path to application log file.
3940
};
4041

libraries/application/src/morpheus/application/po/adapters/boost/asio.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
#include <boost/algorithm/string.hpp>
77
#include <boost/any.hpp>
88
#include <boost/asio/ip/tcp.hpp>
9-
#include <boost/system/error_code.hpp>
109
#include <boost/program_options.hpp>
10+
#include <boost/system/error_code.hpp>
1111

1212
#include <string>
1313
#include <vector>

libraries/application/src/morpheus/application/po/adapters/boost/log.hpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
#pragma once
22

33
// IWYU pragma: always_keep
4-
#include <boost/any.hpp>
54
#include <boost/algorithm/string.hpp>
5+
#include <boost/any.hpp>
66
#include <boost/log/trivial.hpp>
77
#include <boost/program_options.hpp>
88

99
#include <string>
1010
#include <vector>
1111

12-
13-
namespace boost {
12+
namespace boost
13+
{
1414

1515
BOOST_LOG_OPEN_NAMESPACE
1616

17-
namespace trivial {
17+
namespace trivial
18+
{
1819

1920
template <class CharType>
2021
void validate(boost::any& v, std::vector<std::basic_string<CharType>> const& values, severity_level*, int)
@@ -40,8 +41,8 @@ void validate(boost::any& v, std::vector<std::basic_string<CharType>> const& val
4041
throw po::validation_error(po::validation_error::invalid_option_value);
4142
}
4243

43-
}
44+
} // namespace trivial
4445

4546
BOOST_LOG_CLOSE_NAMESPACE
4647

47-
} // namespace boost::log::trivial
48+
} // namespace boost

libraries/application/src/morpheus/application/po/adapters/enum.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#pragma once
22

3-
#include "morpheus/core/meta/concepts/enum.hpp"
43
#include "morpheus/core/conversion/adapters/enum.hpp"
4+
#include "morpheus/core/meta/concepts/enum.hpp"
55

66
#include <boost/any.hpp>
77
#include <boost/program_options.hpp>

libraries/application/src/morpheus/application/po/adapters/scannable.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace boost
1414
{
1515

1616
template <class CharType, typename S>
17-
requires morpheus::meta::concepts::Scannable<S, CharType>
17+
requires morpheus::meta::concepts::Scannable<S, CharType>
1818
void validate(boost::any& v, std::vector<std::basic_string<CharType>> const& values, S*, int)
1919
{
2020
namespace po = boost::program_options;

libraries/application/src/morpheus/application/po/options.hpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
#pragma GCC diagnostic pop
1919
#endif // (MORPHEUS_COMPILER == MORPHEUS_GNUC_COMPILER)
2020

21-
#include <iostream>
2221
#include <filesystem>
22+
#include <iostream>
2323
#include <optional>
2424
#include <span>
2525

@@ -38,17 +38,17 @@ concept CustomProgramOptions = requires(T& t, boost::program_options::options_de
3838
/// Holds common help documentation information for applications.
3939
struct HelpDocumentation
4040
{
41-
std::string_view name; ///< The name of the application, typically the executable name.
42-
std::string_view synopsis; ///< A brief synopsis of the application, typically a one-liner describing its purpose.
41+
std::string_view name; ///< The name of the application, typically the executable name.
42+
std::string_view synopsis; ///< A brief synopsis of the application, typically a one-liner describing its purpose.
4343
std::optional<Version> version; ///< The version of the application, if available.
4444
};
4545

4646
std::optional<int> parseProgramOptions(int argc, char const* const* argv, HelpDocumentation const& msgDetails, CustomProgramOptions auto&... options)
4747
{
48-
return parseProgramOptions(std::span<char const * const>{argv, static_cast<std::size_t>(argc)}, msgDetails, options...);
48+
return parseProgramOptions(std::span<char const* const>{argv, static_cast<std::size_t>(argc)}, msgDetails, options...);
4949
}
5050

51-
std::optional<int> parseProgramOptions(std::span<char const * const> parameters, HelpDocumentation const& msgDetails, CustomProgramOptions auto&... options)
51+
std::optional<int> parseProgramOptions(std::span<char const* const> parameters, HelpDocumentation const& msgDetails, CustomProgramOptions auto&... options)
5252
{
5353
namespace po = boost::program_options;
5454
try
@@ -94,5 +94,4 @@ std::optional<int> parseProgramOptions(std::span<char const * const> parameters,
9494
return std::nullopt;
9595
}
9696

97-
9897
} // namespace morpheus::application::po

libraries/application/tests/po/adapters/scannable.tests.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#include "morpheus/application/po/options.hpp"
21
#include "morpheus/application/po/adapters/scannable.hpp"
2+
#include "morpheus/application/po/options.hpp"
33
#include "morpheus/application/version.hpp"
44
#include "morpheus/core/conformance/scan.hpp"
55
#include "morpheus/logging.hpp"
@@ -70,7 +70,7 @@ TEST_CASE_METHOD(LoggingFixture, "Test parsing of scannable as options", "[morph
7070
return location.coordinates;
7171
};
7272

73-
REQUIRE(getCoordinates("[1, 97]") == Coordinates {1.0, 97.0});
73+
REQUIRE(getCoordinates("[1, 97]") == Coordinates{1.0, 97.0});
7474
}
7575
SECTION("Ensure invalid value parse correctly")
7676
{

libraries/application/tests/po/adapters/std/chrono.tests.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#include "morpheus/application/po/options.hpp"
21
#include "morpheus/application/po/adapters/std/chrono.hpp"
2+
#include "morpheus/application/po/options.hpp"
33
#include "morpheus/application/version.hpp"
44
#include "morpheus/core/conformance/date.hpp"
55
#include "morpheus/core/serialisation/adapters/std/chrono.hpp"
@@ -14,8 +14,8 @@
1414
#include <functional>
1515
#include <optional>
1616
#include <ostream>
17-
#include <string_view>
1817
#include <string>
18+
#include <string_view>
1919

2020
namespace morpheus::application::po
2121
{

libraries/application/tests/po/adapters/std/optional.tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#include "morpheus/application/po/options.hpp"
21
#include "morpheus/application/po/adapters/std/optional.hpp" // IWYU pragma: keep
2+
#include "morpheus/application/po/options.hpp"
33
#include "morpheus/application/version.hpp"
44
#include "morpheus/logging.hpp"
55

libraries/core/mocking/morpheus/core/serialisation/mock/reader.hpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44

55
#include <gmock/gmock.h>
66

7-
#include <cstdint>
87
#include <cstddef>
8+
#include <cstdint>
99
#include <optional>
1010
#include <span>
11-
#include <string_view>
1211
#include <string>
12+
#include <string_view>
1313
#include <vector>
1414

1515
namespace morpheus::serialisation::mock
@@ -70,14 +70,15 @@ class Reader
7070
/// Reads a std::string type from the serialisation.
7171
MOCK_METHOD(std::string, read, (std::string), ());
7272
/// Reads a string literal type from the serialisation.
73-
MOCK_METHOD(std::string, read, (char const * const), ());
73+
MOCK_METHOD(std::string, read, (char const* const), ());
7474
/// Reads a blob of bytes from the serialisation.
7575
MOCK_METHOD(std::vector<std::byte>, read, (std::vector<std::byte>), ());
7676
///@}
7777

7878
/// Template wrapper around read which dispatches to the correct concrete read method based on the type T.
79-
template<typename T>
80-
T read() requires requires(Reader r) { r.read(T{}); }
79+
template <typename T>
80+
T read()
81+
requires requires(Reader r) { r.read(T{}); }
8182
{
8283
return read(T{});
8384
}

0 commit comments

Comments
 (0)