Fix formatting
Change-Id: Ifff22c32adb05098c458f0ddabc24e2c310c2ce3
diff --git a/src/ast_handlers.hpp b/src/ast_handlers.hpp
index 82d0b1d..9f2ddef 100644
--- a/src/ast_handlers.hpp
+++ b/src/ast_handlers.hpp
@@ -408,7 +408,7 @@
}
};
-template<yang::LeafDataTypes TYPE>
+template <yang::LeafDataTypes TYPE>
struct leaf_data_base_class {
yang::LeafDataTypes m_type;
diff --git a/src/grammars.hpp b/src/grammars.hpp
index 0a259b8..de00a8b 100644
--- a/src/grammars.hpp
+++ b/src/grammars.hpp
@@ -222,6 +222,7 @@
auto const leaf_data_enum_def =
createEnumSuggestions >> +char_;
+
auto const leaf_data_decimal_def =
double_;
diff --git a/src/main.cpp b/src/main.cpp
index ec1b45c..f1a2603 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -7,9 +7,9 @@
*/
#include <docopt.h>
#include <iostream>
-#include <sstream>
#include <optional>
#include <replxx.hxx>
+#include <sstream>
#include "NETCONF_CLI_VERSION.h"
#include "interpreter.hpp"
#include "sysrepo_access.hpp"
diff --git a/src/static_schema.cpp b/src/static_schema.cpp
index 60cddf9..8800a9a 100644
--- a/src/static_schema.cpp
+++ b/src/static_schema.cpp
@@ -258,9 +258,7 @@
auto childrenRef = children(locationString);
- std::transform(childrenRef.begin(), childrenRef.end(),
- std::inserter(res, res.end()),
- [] (auto it) { return it.first; });
+ std::transform(childrenRef.begin(), childrenRef.end(), std::inserter(res, res.end()), [](auto it) { return it.first; });
return res;
}
diff --git a/src/static_schema.hpp b/src/static_schema.hpp
index 09841ac..e82d43e 100644
--- a/src/static_schema.hpp
+++ b/src/static_schema.hpp
@@ -40,7 +40,6 @@
using NodeType = boost::variant<yang::container, yang::list, yang::leaf, yang::module>;
-
/*! \class StaticSchema
* \brief Static schema, used mainly for testing
* */
diff --git a/src/yang_schema.cpp b/src/yang_schema.cpp
index 549393a..89c515d 100644
--- a/src/yang_schema.cpp
+++ b/src/yang_schema.cpp
@@ -136,9 +136,9 @@
}
std::vector<libyang::S_Type_Enum> enabled;
- std::copy_if(enm.begin(), enm.end(), std::back_inserter(enabled), [] (const libyang::S_Type_Enum& it) {
+ std::copy_if(enm.begin(), enm.end(), std::back_inserter(enabled), [](const libyang::S_Type_Enum& it) {
auto iffeatures = it->iffeature();
- return std::all_of(iffeatures.begin(), iffeatures.end(), [] (auto it) {return it->value();});
+ return std::all_of(iffeatures.begin(), iffeatures.end(), [](auto it) { return it->value(); });
});
std::set<std::string> enumSet;
@@ -234,8 +234,7 @@
libyang::Schema_Node_List list(getSchemaNode(location, node));
const auto& keysVec = list.keys();
- std::transform(keysVec.begin(), keysVec.end(), std::inserter(keys, keys.begin()),
- [] (const auto& it) {return it->name();});
+ std::transform(keysVec.begin(), keysVec.end(), std::inserter(keys, keys.begin()), [](const auto& it) { return it->name(); });
return keys;
}
@@ -276,7 +275,6 @@
using namespace std::string_literals;
throw std::logic_error{"internal error: unsupported libyang data type "s + std::to_string(type)};
}
-
}
yang::LeafDataTypes YangSchema::leafType(const schemaPath_& location, const ModuleNodePair& node) const
@@ -289,18 +287,18 @@
auto baseType{leaf.type()->base()};
try {
return lyTypeToLeafDataTypes(baseType);
- } catch(std::logic_error& ex) {
+ } catch (std::logic_error& ex) {
throw UnsupportedYangTypeException("the type of "s + fullNodeName(location, node) + " is not supported: " + ex.what());
}
}
-yang::LeafDataTypes YangSchema::leafrefBase(const schemaPath_& location, const ModuleNodePair & node) const
+yang::LeafDataTypes YangSchema::leafrefBase(const schemaPath_& location, const ModuleNodePair& node) const
{
using namespace std::string_literals;
libyang::Schema_Node_Leaf leaf(getSchemaNode(location, node));
try {
return lyTypeToLeafDataTypes(leaf.type()->info()->lref()->target()->type()->base());
- } catch(std::logic_error& ex) {
+ } catch (std::logic_error& ex) {
throw UnsupportedYangTypeException("the type of "s + fullNodeName(location, node) + " is not supported: " + ex.what());
}
}
@@ -310,9 +308,7 @@
const auto& modules = m_context->get_module_iter();
std::set<std::string> res;
- std::transform(modules.begin(), modules.end(),
- std::inserter(res, res.end()),
- [] (const auto module) { return module->name(); });
+ std::transform(modules.begin(), modules.end(), std::inserter(res, res.end()), [](const auto module) { return module->name(); });
return res;
}
diff --git a/tests/doctest_integration.cpp b/tests/doctest_integration.cpp
index b333b7d..4538dde 100644
--- a/tests/doctest_integration.cpp
+++ b/tests/doctest_integration.cpp
@@ -2,23 +2,19 @@
#include <doctest/doctest.h>
#include <trompeloeil.hpp>
-namespace trompeloeil
-{
- template <>
- void reporter<specialized>::send(
+namespace trompeloeil {
+template <>
+void reporter<specialized>::send(
severity s,
const char* file,
unsigned long line,
const char* msg)
- {
+{
auto f = line ? file : "[file/line unavailable]";
- if (s == severity::fatal)
- {
- ADD_FAIL_AT(f, line, msg);
+ if (s == severity::fatal) {
+ ADD_FAIL_AT(f, line, msg);
+ } else {
+ ADD_FAIL_CHECK_AT(f, line, msg);
}
- else
- {
- ADD_FAIL_CHECK_AT(f, line, msg);
- }
- }
+}
}
diff --git a/tests/path_completion.cpp b/tests/path_completion.cpp
index c68cca0..cff254f 100644
--- a/tests/path_completion.cpp
+++ b/tests/path_completion.cpp
@@ -88,7 +88,6 @@
{
input = "ls /e";
expected = {"example:ano/", "example:anoda/", "example:bota/", "example:leafInt ", "example:list[", "example:ovoce[", "example:ovocezelenina[", "example:twoKeyList["};
-
}
SECTION("ls example:bota")
diff --git a/tests/wait-a-bit-longer.cpp b/tests/wait-a-bit-longer.cpp
index 8ec4f4b..a29f3a2 100644
--- a/tests/wait-a-bit-longer.cpp
+++ b/tests/wait-a-bit-longer.cpp
@@ -1,5 +1,5 @@
-#include <doctest/doctest.h>
#include <chrono>
+#include <doctest/doctest.h>
#include <thread>
#include <trompeloeil.hpp>
diff --git a/tests/yang.cpp b/tests/yang.cpp
index 2ca1704..6ce0fb2 100644
--- a/tests/yang.cpp
+++ b/tests/yang.cpp
@@ -454,7 +454,6 @@
SECTION("small")
{
value = "small";
-
}
SECTION("medium")
{