Skip to content

Commit 41537a6

Browse files
authored
Fix ci: codespell (#2259)
1 parent a32dc67 commit 41537a6

File tree

7 files changed

+28
-28
lines changed

7 files changed

+28
-28
lines changed

.github/workflows/codespell.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/checkout@v4
14-
- run: pip install --user codespell[toml]
15-
- run: codespell --ignore-words-list="coo,folx,ot,statics,xwindows,NotIn," --skip="*.csp"
14+
- run: sudo apt-get install -y codespell
15+
- run: codespell --ignore-words-list="coo,folx,ot,statics,xwindows,NotIn,aNULL," --skip="*.csp"

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ set(INSTALL_DROGON_CMAKE_DIR ${DEF_INSTALL_DROGON_CMAKE_DIR}
4242
if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
4343
# Force MSVC to use UTF-8 because that's what we use. Otherwise it uses
4444
# the default of whatever Windows sets and causes encoding issues.
45-
message(STATUS "You are using MSVC. Forceing to use UTF-8")
45+
message(STATUS "You are using MSVC. Forcing to use UTF-8")
4646
add_compile_options("$<$<C_COMPILER_ID:MSVC>:/utf-8>")
4747
add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/utf-8>")
4848
if (MSVC_VERSION GREATER_EQUAL 1914)

ChangeLog.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ All notable changes to this project will be documented in this file.
461461

462462
- Remove unused CI files and Jekyll config.
463463

464-
- Ensure that all filters, AOP advices, and handlers are executed within the IO threads.
464+
- Ensure that all filters, AOP advice, and handlers are executed within the IO threads.
465465

466466
- Update test.sh and build.sh by appending prefix "X" to string variable comparisons.
467467

@@ -793,7 +793,7 @@ All notable changes to this project will be documented in this file.
793793

794794
- Check HTTP client is not sending requests in sync mode on the same event loop.
795795

796-
- Start listening after beginning advices.
796+
- Start listening after beginning advice.
797797

798798
- Allow using json_cpp in other sublibraries.
799799

lib/inc/drogon/HttpAppFramework.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ class DROGON_EXPORT HttpAppFramework : public trantor::NonCopyable
349349

350350
/// Register an advice called before routing
351351
/**
352-
* @param advice is called after all the synchronous advices return
352+
* @param advice is called after all the synchronous advice return
353353
* nullptr and before the request is routed to any handler. The parameters
354354
* of the advice are same as those of the doFilter method of the Filter
355355
* class.

lib/src/AOPAdvice.cc

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
namespace drogon
2121
{
2222

23-
static void doAdvicesChain(
23+
static void doAdviceChain(
2424
const std::vector<std::function<void(const HttpRequestPtr &,
2525
AdviceCallback &&,
26-
AdviceChainCallback &&)>> &advices,
26+
AdviceChainCallback &&)>> &adviceChain,
2727
size_t index,
2828
const HttpRequestImplPtr &req,
2929
std::shared_ptr<const std::function<void(const HttpResponsePtr &)>>
@@ -88,7 +88,7 @@ void AopAdvice::passPreRoutingAdvices(
8888

8989
auto callbackPtr =
9090
std::make_shared<std::decay_t<decltype(callback)>>(std::move(callback));
91-
doAdvicesChain(preRoutingAdvices_, 0, req, std::move(callbackPtr));
91+
doAdviceChain(preRoutingAdvices_, 0, req, std::move(callbackPtr));
9292
}
9393

9494
void AopAdvice::passPostRoutingObservers(const HttpRequestImplPtr &req) const
@@ -114,7 +114,7 @@ void AopAdvice::passPostRoutingAdvices(
114114

115115
auto callbackPtr =
116116
std::make_shared<std::decay_t<decltype(callback)>>(std::move(callback));
117-
doAdvicesChain(postRoutingAdvices_, 0, req, std::move(callbackPtr));
117+
doAdviceChain(postRoutingAdvices_, 0, req, std::move(callbackPtr));
118118
}
119119

120120
void AopAdvice::passPreHandlingObservers(const HttpRequestImplPtr &req) const
@@ -140,7 +140,7 @@ void AopAdvice::passPreHandlingAdvices(
140140

141141
auto callbackPtr =
142142
std::make_shared<std::decay_t<decltype(callback)>>(std::move(callback));
143-
doAdvicesChain(preHandlingAdvices_, 0, req, std::move(callbackPtr));
143+
doAdviceChain(preHandlingAdvices_, 0, req, std::move(callbackPtr));
144144
}
145145

146146
void AopAdvice::passPostHandlingAdvices(const HttpRequestImplPtr &req,
@@ -161,43 +161,43 @@ void AopAdvice::passPreSendingAdvices(const HttpRequestImplPtr &req,
161161
}
162162
}
163163

164-
static void doAdvicesChain(
164+
static void doAdviceChain(
165165
const std::vector<std::function<void(const HttpRequestPtr &,
166166
AdviceCallback &&,
167-
AdviceChainCallback &&)>> &advices,
167+
AdviceChainCallback &&)>> &adviceChain,
168168
size_t index,
169169
const HttpRequestImplPtr &req,
170170
std::shared_ptr<const std::function<void(const HttpResponsePtr &)>>
171171
&&callbackPtr)
172172
{
173-
if (index < advices.size())
173+
if (index < adviceChain.size())
174174
{
175-
auto &advice = advices[index];
175+
auto &advice = adviceChain[index];
176176
advice(
177177
req,
178178
[/*copy*/ callbackPtr](const HttpResponsePtr &resp) {
179179
(*callbackPtr)(resp);
180180
},
181-
[index, req, callbackPtr, &advices]() mutable {
181+
[index, req, callbackPtr, &adviceChain]() mutable {
182182
auto ioLoop = req->getLoop();
183183
if (ioLoop && !ioLoop->isInLoopThread())
184184
{
185185
ioLoop->queueInLoop([index,
186186
req,
187187
callbackPtr = std::move(callbackPtr),
188-
&advices]() mutable {
189-
doAdvicesChain(advices,
190-
index + 1,
191-
req,
192-
std::move(callbackPtr));
188+
&adviceChain]() mutable {
189+
doAdviceChain(adviceChain,
190+
index + 1,
191+
req,
192+
std::move(callbackPtr));
193193
});
194194
}
195195
else
196196
{
197-
doAdvicesChain(advices,
198-
index + 1,
199-
req,
200-
std::move(callbackPtr));
197+
doAdviceChain(adviceChain,
198+
index + 1,
199+
req,
200+
std::move(callbackPtr));
201201
}
202202
});
203203
}

lib/src/HttpServer.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ void HttpServer::onRequests(
313313
return;
314314
}
315315

316-
// flush response for not passing sync advices
316+
// flush response for not passing sync advice
317317
if (conn->connected() && !requestParser->getResponseBuffer().empty())
318318
{
319319
sendResponses(conn,
@@ -1202,7 +1202,7 @@ static inline HttpResponsePtr tryDecompressRequest(
12021202
* @brief Check request against each sync advice, generate response if request
12031203
* is rejected by any one of them.
12041204
*
1205-
* @return true if all sync advices are passed.
1205+
* @return true if all sync advice are passed.
12061206
* @return false if rejected by any sync advice.
12071207
*/
12081208
static inline bool passSyncAdvices(

0 commit comments

Comments
 (0)