Change clang format line width to 120
This commit is contained in:
parent
2d63375daa
commit
22c858dd59
|
@ -10,7 +10,7 @@ BreakBeforeBraces: Allman
|
||||||
BreakBeforeConceptDeclarations: Always
|
BreakBeforeConceptDeclarations: Always
|
||||||
BreakBeforeTernaryOperators: true
|
BreakBeforeTernaryOperators: true
|
||||||
BreakInheritanceList: BeforeColon
|
BreakInheritanceList: BeforeColon
|
||||||
ColumnLimit: 100
|
ColumnLimit: 120
|
||||||
Cpp11BracedListStyle: false
|
Cpp11BracedListStyle: false
|
||||||
EmptyLineBeforeAccessModifier: Never
|
EmptyLineBeforeAccessModifier: Never
|
||||||
FixNamespaceComments: false
|
FixNamespaceComments: false
|
||||||
|
|
|
@ -28,6 +28,6 @@ class RedNosedReports
|
||||||
virtual void processDataLine(const std::string& line) override;
|
virtual void processDataLine(const std::string& line) override;
|
||||||
virtual void finish() override;
|
virtual void finish() override;
|
||||||
private:
|
private:
|
||||||
void checkLastLevel(const Slope sameSlope, const Slope otherSlope,
|
void checkLastLevel(const Slope sameSlope, const Slope otherSlope, const int delta, const int sign,
|
||||||
const int delta, const int sign, RedNosedReportData& data);
|
RedNosedReportData& data);
|
||||||
};
|
};
|
||||||
|
|
|
@ -33,8 +33,7 @@ void LanParty::processDataLine(const std::string& line)
|
||||||
void LanParty::finish()
|
void LanParty::finish()
|
||||||
{
|
{
|
||||||
auto vertices = lan_.getVertices();
|
auto vertices = lan_.getVertices();
|
||||||
// This works as long as "ta" is present as a computername, otherwise we would have to use
|
// This works as long as "ta" is present as a computername, otherwise we would have to use vertices.find_if().
|
||||||
// vertices.find_if().
|
|
||||||
auto iterTx = vertices.find(getFirstTxComputerName());
|
auto iterTx = vertices.find(getFirstTxComputerName());
|
||||||
while (iterTx != vertices.end() && iterTx->second->getId() <= getLastTxComputerName())
|
while (iterTx != vertices.end() && iterTx->second->getId() <= getLastTxComputerName())
|
||||||
{
|
{
|
||||||
|
|
|
@ -23,10 +23,9 @@ const Point2 Point2::upLeft{ -1, -1 };
|
||||||
const Point2 Point2::upRight{ 1, -1 };
|
const Point2 Point2::upRight{ 1, -1 };
|
||||||
const Point2 Point2::downLeft{ -1, 1 };
|
const Point2 Point2::downLeft{ -1, 1 };
|
||||||
const Point2 Point2::downRight{ 1, 1 };
|
const Point2 Point2::downRight{ 1, 1 };
|
||||||
const Point2 Point2::directions[] = { Point2::down, Point2::downRight, Point2::right,
|
const Point2 Point2::directions[] = { Point2::down, Point2::downRight, Point2::right, Point2::upRight, Point2::up,
|
||||||
Point2::upRight, Point2::up, Point2::upLeft, Point2::left, Point2::downLeft };
|
Point2::upLeft, Point2::left, Point2::downLeft };
|
||||||
const Point2 Point2::cardinalDirections[] = { Point2::down, Point2::right, Point2::up,
|
const Point2 Point2::cardinalDirections[] = { Point2::down, Point2::right, Point2::up, Point2::left };
|
||||||
Point2::left};
|
|
||||||
|
|
||||||
Point2::Point2()
|
Point2::Point2()
|
||||||
: Point2{ 0, 0 } {}
|
: Point2{ 0, 0 } {}
|
||||||
|
|
|
@ -29,11 +29,9 @@ const std::string RedNosedReports::getInputFileName() const
|
||||||
return "red-nosed_reports.txt";
|
return "red-nosed_reports.txt";
|
||||||
}
|
}
|
||||||
|
|
||||||
// 'X' in the comments here and below marks the level that must be ignored to
|
// 'X' in the comments here and below marks the level that must be ignored to make the report safe.
|
||||||
// make the report safe.
|
|
||||||
// 'first' means that this series starts at the beginning of the line.
|
// '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
|
// 'next' means that the level(s) from the next loop iteration(s) will determine which level to ignore.
|
||||||
// which level to ignore.
|
|
||||||
void RedNosedReports::processDataLine(const std::string& line)
|
void RedNosedReports::processDataLine(const std::string& line)
|
||||||
{
|
{
|
||||||
RedNosedReportData data{};
|
RedNosedReportData data{};
|
||||||
|
@ -111,8 +109,8 @@ void RedNosedReports::finish()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void RedNosedReports::checkLastLevel(const Slope sameSlope, const Slope otherSlope,
|
void RedNosedReports::checkLastLevel(const Slope sameSlope, const Slope otherSlope, const int delta, const int sign,
|
||||||
const int delta, const int sign, RedNosedReportData& data)
|
RedNosedReportData& data)
|
||||||
{
|
{
|
||||||
if (data.slope == sameSlope)
|
if (data.slope == sameSlope)
|
||||||
{
|
{
|
||||||
|
|
|
@ -38,8 +38,7 @@ void SolverEngine::run(Solver& solver)
|
||||||
|
|
||||||
solver.finish();
|
solver.finish();
|
||||||
|
|
||||||
std::cout << "Part 1: " << solver.getResultPart1()
|
std::cout << "Part 1: " << solver.getResultPart1() << "\nPart 2: " << solver.getResultPart2() << std::endl;
|
||||||
<< "\nPart 2: " << solver.getResultPart2() << std::endl;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,8 +24,8 @@
|
||||||
class TestContext
|
class TestContext
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void run(const std::unique_ptr<Solver>&& solver, const long long int expected1,
|
void run(const std::unique_ptr<Solver>&& solver, const long long int expected1, const long long int expected2,
|
||||||
const long long int expected2, const std::vector<std::string>& inputPaths);
|
const std::vector<std::string>& inputPaths);
|
||||||
std::vector<std::string> getInputPaths() const;
|
std::vector<std::string> getInputPaths() const;
|
||||||
std::vector<std::string> getExampleInputPaths() const;
|
std::vector<std::string> getExampleInputPaths() const;
|
||||||
};
|
};
|
||||||
|
|
|
@ -36,6 +36,5 @@ std::vector<std::string> TestContext::getInputPaths() const
|
||||||
|
|
||||||
std::vector<std::string> TestContext::getExampleInputPaths() const
|
std::vector<std::string> TestContext::getExampleInputPaths() const
|
||||||
{
|
{
|
||||||
return std::vector<std::string>{ "data/examples", "../../../data/examples",
|
return std::vector<std::string>{ "data/examples", "../../../data/examples", "../../../../data/examples" };
|
||||||
"../../../../data/examples" };
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue