diff --git a/.clang-format b/.clang-format index b8bcb7e..ffb1487 100644 --- a/.clang-format +++ b/.clang-format @@ -10,7 +10,7 @@ BreakBeforeBraces: Allman BreakBeforeConceptDeclarations: Always BreakBeforeTernaryOperators: true BreakInheritanceList: BeforeColon -ColumnLimit: 100 +ColumnLimit: 120 Cpp11BracedListStyle: false EmptyLineBeforeAccessModifier: Never FixNamespaceComments: false diff --git a/include/aoc/RedNosedReports.hpp b/include/aoc/RedNosedReports.hpp index a42aef7..6e6aba5 100644 --- a/include/aoc/RedNosedReports.hpp +++ b/include/aoc/RedNosedReports.hpp @@ -28,6 +28,6 @@ class RedNosedReports virtual void processDataLine(const std::string& line) override; virtual void finish() override; private: - void checkLastLevel(const Slope sameSlope, const Slope otherSlope, - const int delta, const int sign, RedNosedReportData& data); + void checkLastLevel(const Slope sameSlope, const Slope otherSlope, const int delta, const int sign, + RedNosedReportData& data); }; diff --git a/src/LanParty.cpp b/src/LanParty.cpp index 4776b7c..1d3fa82 100644 --- a/src/LanParty.cpp +++ b/src/LanParty.cpp @@ -33,8 +33,7 @@ void LanParty::processDataLine(const std::string& line) void LanParty::finish() { auto vertices = lan_.getVertices(); - // This works as long as "ta" is present as a computername, otherwise we would have to use - // vertices.find_if(). + // This works as long as "ta" is present as a computername, otherwise we would have to use vertices.find_if(). auto iterTx = vertices.find(getFirstTxComputerName()); while (iterTx != vertices.end() && iterTx->second->getId() <= getLastTxComputerName()) { diff --git a/src/Point2.cpp b/src/Point2.cpp index 5340d53..87e959d 100644 --- a/src/Point2.cpp +++ b/src/Point2.cpp @@ -23,10 +23,9 @@ const Point2 Point2::upLeft{ -1, -1 }; const Point2 Point2::upRight{ 1, -1 }; const Point2 Point2::downLeft{ -1, 1 }; const Point2 Point2::downRight{ 1, 1 }; -const Point2 Point2::directions[] = { Point2::down, Point2::downRight, Point2::right, - Point2::upRight, Point2::up, Point2::upLeft, Point2::left, Point2::downLeft }; -const Point2 Point2::cardinalDirections[] = { Point2::down, Point2::right, Point2::up, - Point2::left}; +const Point2 Point2::directions[] = { Point2::down, Point2::downRight, Point2::right, Point2::upRight, Point2::up, + Point2::upLeft, Point2::left, Point2::downLeft }; +const Point2 Point2::cardinalDirections[] = { Point2::down, Point2::right, Point2::up, Point2::left }; Point2::Point2() : Point2{ 0, 0 } {} diff --git a/src/RedNosedReports.cpp b/src/RedNosedReports.cpp index 31abc2d..e63988b 100644 --- a/src/RedNosedReports.cpp +++ b/src/RedNosedReports.cpp @@ -29,11 +29,9 @@ const std::string RedNosedReports::getInputFileName() const return "red-nosed_reports.txt"; } -// 'X' in the comments here and below marks the level that must be ignored to -// make the report safe. +// 'X' in the comments here and below marks the level that must be ignored to make the report safe. // 'first' means that this series starts at the beginning of the line. -// 'next' means that the level(s) from the next loop iteration(s) will determine -// which level to ignore. +// 'next' means that the level(s) from the next loop iteration(s) will determine which level to ignore. void RedNosedReports::processDataLine(const std::string& line) { RedNosedReportData data{}; @@ -111,8 +109,8 @@ void RedNosedReports::finish() { } -void RedNosedReports::checkLastLevel(const Slope sameSlope, const Slope otherSlope, - const int delta, const int sign, RedNosedReportData& data) +void RedNosedReports::checkLastLevel(const Slope sameSlope, const Slope otherSlope, const int delta, const int sign, + RedNosedReportData& data) { if (data.slope == sameSlope) { diff --git a/src/SolverEngine.cpp b/src/SolverEngine.cpp index 71ee045..f179d1a 100644 --- a/src/SolverEngine.cpp +++ b/src/SolverEngine.cpp @@ -38,8 +38,7 @@ void SolverEngine::run(Solver& solver) solver.finish(); - std::cout << "Part 1: " << solver.getResultPart1() - << "\nPart 2: " << solver.getResultPart2() << std::endl; + std::cout << "Part 1: " << solver.getResultPart1() << "\nPart 2: " << solver.getResultPart2() << std::endl; } } diff --git a/tests/include/aocTests/TestContext.hpp b/tests/include/aocTests/TestContext.hpp index 66b4214..845b8ff 100644 --- a/tests/include/aocTests/TestContext.hpp +++ b/tests/include/aocTests/TestContext.hpp @@ -24,8 +24,8 @@ class TestContext { public: - void run(const std::unique_ptr&& solver, const long long int expected1, - const long long int expected2, const std::vector& inputPaths); + void run(const std::unique_ptr&& solver, const long long int expected1, const long long int expected2, + const std::vector& inputPaths); std::vector getInputPaths() const; std::vector getExampleInputPaths() const; }; diff --git a/tests/src/TestContext.cpp b/tests/src/TestContext.cpp index 2234036..9f71caf 100644 --- a/tests/src/TestContext.cpp +++ b/tests/src/TestContext.cpp @@ -36,6 +36,5 @@ std::vector TestContext::getInputPaths() const std::vector TestContext::getExampleInputPaths() const { - return std::vector{ "data/examples", "../../../data/examples", - "../../../../data/examples" }; + return std::vector{ "data/examples", "../../../data/examples", "../../../../data/examples" }; }