Add newline at EOF (#1932)

This commit is contained in:
Ken Matsui 2024-01-30 18:43:30 -08:00 committed by GitHub
parent 674137e89d
commit 56a53165b6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
58 changed files with 58 additions and 57 deletions

View File

@ -75,6 +75,7 @@ IndentCaseLabels: true
IndentPPDirectives: None
IndentWidth: 4
IndentWrappedFunctionNames: false
InsertNewlineAtEOF: true
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false

View File

@ -468,4 +468,4 @@ void create_controller::createARestfulController(const std::string &className,
<< std::endl;
std::cout << "File name: " << ctlName << ".h and " << ctlName << ".cc"
<< std::endl;
}
}

View File

@ -8,4 +8,4 @@ void JsonCtrl::asyncHandleHttpRequest(
ret["message"] = "Hello, World!";
auto resp = HttpResponse::newHttpJsonResponse(ret);
callback(resp);
}
}

View File

@ -43,4 +43,4 @@ int main()
.setUploadPath("./uploads")
.addListener("127.0.0.1", 8848)
.run();
}
}

View File

@ -37,4 +37,4 @@ class SayHello : public HttpController<SayHello>
"Hi there, this is another hello from the SayHello Controller");
callback(resp);
}
};
};

View File

@ -26,4 +26,4 @@ class HelloViewController : public HttpSimpleController<HelloViewController>
auto resp = HttpResponse::newHttpViewResponse("HelloView", data);
callback(resp);
}
};
};

View File

@ -211,4 +211,4 @@ class JsonStore : public HttpController<JsonStore>
int main()
{
app().addListener("127.0.0.1", 8848).run();
}
}

View File

@ -65,4 +65,4 @@ int main()
.enableSession(24h)
.addListener("127.0.0.1", 8848)
.run();
}
}

View File

@ -11,4 +11,4 @@ template <>
inline std::string toString<trantor::Date>(const trantor::Date &date)
{
return std::to_string(date.microSecondsSinceEpoch());
}
}

View File

@ -70,4 +70,4 @@ void TimeFilter::doFilter(const HttpRequestPtr &req,
co_return;
}
});
}
}

View File

@ -97,4 +97,4 @@ void SimpleReverseProxy::preRouting(const HttpRequestPtr &req,
callback(errResp);
}
});
}
}

View File

@ -70,4 +70,4 @@ void WebSocketChat::handleNewConnection(const HttpRequestPtr &req,
int main()
{
app().addListener("127.0.0.1", 8848).run();
}
}

View File

@ -116,4 +116,4 @@ class DROGON_EXPORT Redirector : public drogon::Plugin<Redirector>,
};
} // namespace plugin
} // namespace drogon
} // namespace drogon

View File

@ -144,4 +144,4 @@ class OStringStream
private:
std::string buffer_;
};
} // namespace drogon
} // namespace drogon

View File

@ -15,4 +15,4 @@
#include <drogon/utils/monitoring/Metric.h>
#include <drogon/utils/monitoring/Registry.h>
#include <drogon/utils/monitoring/Collector.h>
#include <drogon/utils/monitoring/Sample.h>
#include <drogon/utils/monitoring/Sample.h>

View File

@ -129,4 +129,4 @@ class Collector : public CollectorBase
mutable std::mutex mutex_;
};
} // namespace monitoring
} // namespace drogon
} // namespace drogon

View File

@ -106,4 +106,4 @@ class Gauge : public Metric
trantor::Date timestamp_{0};
};
} // namespace monitoring
} // namespace drogon
} // namespace drogon

View File

@ -74,4 +74,4 @@ class Metric : public std::enable_shared_from_this<Metric>
using MetricPtr = std::shared_ptr<Metric>;
} // namespace monitoring
} // namespace drogon
} // namespace drogon

View File

@ -32,4 +32,4 @@ class Registry
const std::shared_ptr<CollectorBase> &collector) = 0;
};
} // namespace monitoring
} // namespace drogon
} // namespace drogon

View File

@ -32,4 +32,4 @@ struct Sample
std::vector<std::pair<std::string, std::string>> exLabels;
};
} // namespace monitoring
} // namespace drogon
} // namespace drogon

View File

@ -72,4 +72,4 @@ class LifeTimeWatch
StopWatch stopWatch_;
std::function<void(double)> callback_;
};
} // namespace drogon
} // namespace drogon

View File

@ -18,4 +18,4 @@ class ConfigAdapter
using ConfigAdapterPtr = std::shared_ptr<ConfigAdapter>;
} // namespace drogon
} // namespace drogon

View File

@ -37,4 +37,4 @@ ConfigAdapterManager::ConfigAdapterManager()
{
REGISTER_CONFIG_ADAPTER(JsonConfigAdapter);
REGISTER_CONFIG_ADAPTER(YamlConfigAdapter);
}
}

View File

@ -16,4 +16,4 @@ class ConfigAdapterManager
ConfigAdapterManager();
std::map<std::string, ConfigAdapterPtr> adapters_;
};
} // namespace drogon
} // namespace drogon

View File

@ -55,4 +55,4 @@ bool DbClientManager::areAllDbClientsAvailable() const noexcept
DbClientManager::~DbClientManager()
{
}
}

View File

@ -29,4 +29,4 @@ bool FixedWindowRateLimiter::isAllowed()
return true;
}
return false;
}
}

View File

@ -105,4 +105,4 @@ void GlobalFilters::initAndStart(const Json::Value &config)
void GlobalFilters::shutdown()
{
filters_.clear();
}
}

View File

@ -77,4 +77,4 @@ std::vector<Sample> Histogram::collect() const
countSample.value = totalCount;
samples.emplace_back(std::move(countSample));
return samples;
}
}

View File

@ -26,4 +26,4 @@ void handleException(const std::exception &e,
app().getExceptionHandler()(e, req, std::move(callback));
}
} // namespace internal
} // namespace drogon
} // namespace drogon

View File

@ -730,4 +730,4 @@ void HttpClientImpl::addSSLConfigs(
{
sslConfCmds_.push_back(cmd);
}
}
}

View File

@ -44,4 +44,4 @@ std::string HttpViewData::htmlTranslate(const char *str, size_t length)
++str;
}
return ret;
}
}

View File

@ -12,4 +12,4 @@ class JsonConfigAdapter : public ConfigAdapter
noexcept(false) override;
std::vector<std::string> getExtensions() const override;
};
} // namespace drogon
} // namespace drogon

View File

@ -118,4 +118,4 @@ std::shared_ptr<PluginBase> PluginsManager::getSharedPlugin(
return iter->second;
}
return nullptr;
}
}

View File

@ -51,4 +51,4 @@ void RedisClientManager::createRedisClient(const std::string & /*name*/,
RedisClientManager::~RedisClientManager()
{
}
}

View File

@ -69,4 +69,4 @@ bool RedisResult::isNil() const noexcept
abort();
}
} // namespace nosql
} // namespace drogon
} // namespace drogon

View File

@ -20,4 +20,4 @@ class SlidingWindowRateLimiter : public RateLimiter
std::chrono::steady_clock::time_point lastTime_;
std::chrono::duration<double> timeUnit_;
};
} // namespace drogon
} // namespace drogon

View File

@ -38,4 +38,4 @@ void TaskTimeoutFlag::runTimer()
bool TaskTimeoutFlag::done()
{
return isDone_.exchange(true);
}
}

View File

@ -36,4 +36,4 @@ class TaskTimeoutFlag : public trantor::NonCopyable,
std::chrono::duration<double> timeout_;
std::function<void()> timeoutFunc_;
};
} // namespace drogon
} // namespace drogon

View File

@ -12,4 +12,4 @@ class YamlConfigAdapter : public ConfigAdapter
noexcept(false) override;
std::vector<std::string> getExtensions() const override;
};
} // namespace drogon
} // namespace drogon

View File

@ -214,4 +214,4 @@ void DigestAuthFilter::doFilter(const HttpRequestPtr &req,
"\", opaque=\"" + opaque + "\"");
cb(resp);
return;
}
}

View File

@ -30,4 +30,4 @@ class DigestAuthFilter : public drogon::HttpFilter<DigestAuthFilter, false>
virtual void doFilter(const HttpRequestPtr &req,
FilterCallback &&cb,
FilterChainCallback &&ccb) override;
};
};

View File

@ -11,4 +11,4 @@ void ForwardCtrl::asyncHandleHttpRequest(
callback(resp);
},
"https://api.github.com");
}
}

View File

@ -53,4 +53,4 @@ void MethodTest::postRegex(
{
LOG_DEBUG << regStr;
makePostRespose(callback);
}
}

View File

@ -45,4 +45,4 @@ void TimeFilter::doFilter(const HttpRequestPtr &req,
LOG_TRACE << "first visit,insert visitDate";
req->session()->insert(VDate, now);
ccb();
}
}

View File

@ -526,4 +526,4 @@ void ApiTest::echoBody(const HttpRequestPtr &req,
auto resp = HttpResponse::newHttpResponse();
resp->setBody(std::string(req->body()));
callback(resp);
}
}

View File

@ -26,4 +26,4 @@ DROGON_TEST(ClassName)
CHECK(h.className() == "api::v1::hh");
CHECK(api::v1::hh::classTypeName() == "api::v1::hh");
CHECK(h.name() == "api::v1::hh");
}
}

View File

@ -45,4 +45,4 @@ DROGON_TEST(ControllerCreation)
REQUIRE(Ctrl::created == false);
REQUIRE(SimpleCtrl::created == false);
REQUIRE(WsCtrl::created == false);
}
}

View File

@ -40,4 +40,4 @@ DROGON_TEST(DrObjectNamespaceTest)
auto objPtr2 = DrClassMap::getSingleInstance<::test::TestB>();
CHECK(objPtr2.get() != nullptr);
CHECK(objPtr == objPtr2);
}
}

View File

@ -39,4 +39,4 @@ DROGON_TEST(FileTypeTest)
CHECK(parseFileType("") == FT_UNKNOWN);
CHECK(parseFileType("don'tknow") == FT_CUSTOM);
}
}
}

View File

@ -316,4 +316,4 @@ DROGON_TEST(Gzip)
auto decompressStr = utils::gzipDecompress(ret.data(), ret.length());
CHECK(inStr == decompressStr);
}
}

View File

@ -56,4 +56,4 @@ DROGON_TEST(OStringStreamTest)
CHECK(ss.str() == "hello world!1233.14");
}
}
}

View File

@ -9,4 +9,4 @@ DROGON_TEST(SHA1Test)
"678901234567890123456789012345678901234567890";
auto str = drogon::utils::getSha1(in, strlen((const char *)in));
CHECK(str == "FECFD28BBC9345891A66D7C1B8FF46E60192D284");
}
}

View File

@ -66,4 +66,4 @@ class RedisException final : public std::exception
using RedisExceptionCallback = std::function<void(const RedisException &)>;
} // namespace nosql
} // namespace drogon
} // namespace drogon

View File

@ -68,4 +68,4 @@ class RedisTransactionImpl final
double timeout_{-1.0};
};
} // namespace nosql
} // namespace drogon
} // namespace drogon

View File

@ -180,4 +180,4 @@ class DROGON_EXPORT RestfulController : trantor::NonCopyable
std::unordered_map<std::string, size_t> masqueradingMap_;
const std::vector<std::string> columnsVector_;
};
} // namespace drogon
} // namespace drogon

View File

@ -80,4 +80,4 @@ orm::Criteria RestfulController::makeCriteria(
}
}
return ret;
}
}

View File

@ -125,4 +125,4 @@ int main()
};
LOG_TRACE << "end";
getchar();
}
}

View File

@ -50,4 +50,4 @@ class Sqlite3ResultImpl : public ResultImpl
size_t insertId_{0};
};
} // namespace orm
} // namespace drogon
} // namespace drogon