mirror of
https://github.com/XRPLF/clio.git
synced 2025-11-17 02:05:52 +00:00
style: Use codespell instead of typos pre-commit hook (#2104)
This commit is contained in:
@@ -37,10 +37,15 @@ repos:
|
||||
- id: markdownlint-fix
|
||||
exclude: LICENSE.md
|
||||
|
||||
- repo: https://github.com/crate-ci/typos
|
||||
rev: v1.31.2
|
||||
- repo: https://github.com/codespell-project/codespell
|
||||
rev: v2.4.1
|
||||
hooks:
|
||||
- id: typos
|
||||
- id: codespell
|
||||
args:
|
||||
[
|
||||
--write-changes,
|
||||
--ignore-words=pre-commit-hooks/codespell_ignore.txt,
|
||||
]
|
||||
|
||||
# Running fix-local-includes before clang-format
|
||||
# to ensure that the include order is correct.
|
||||
|
||||
22
_typos.toml
22
_typos.toml
@@ -1,22 +0,0 @@
|
||||
[default]
|
||||
# This allows to ignore account ids in tests and private keys
|
||||
# More info: https://github.com/crate-ci/typos/issues/415
|
||||
extend-ignore-re = [
|
||||
"[a-z-A-Z0-9]{33}",
|
||||
"[a-z-A-Z0-9]{34}",
|
||||
"[a-z-A-Z0-9]{64}",
|
||||
]
|
||||
|
||||
[default.extend-identifiers]
|
||||
# (S)tring
|
||||
tring = "tring"
|
||||
trings = "trings"
|
||||
|
||||
ASSERTs = "ASSERTs"
|
||||
EXCLUDEs = "EXCLUDEs"
|
||||
|
||||
ser = "ser"
|
||||
|
||||
[default.extend-words]
|
||||
strat = "strat"
|
||||
datas = "datas"
|
||||
@@ -26,7 +26,7 @@ set(COMPILER_FLAGS
|
||||
# TODO: Address these and others in https://github.com/XRPLF/clio/issues/1273
|
||||
)
|
||||
|
||||
# TODO: reenable when we change CI #884 if (is_gcc AND NOT lint) list(APPEND COMPILER_FLAGS -Wduplicated-branches
|
||||
# TODO: re-enable when we change CI #884 if (is_gcc AND NOT lint) list(APPEND COMPILER_FLAGS -Wduplicated-branches
|
||||
# -Wduplicated-cond -Wlogical-op -Wuseless-cast ) endif ()
|
||||
|
||||
if (is_clang)
|
||||
|
||||
9
pre-commit-hooks/codespell_ignore.txt
Normal file
9
pre-commit-hooks/codespell_ignore.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
ser
|
||||
onWs
|
||||
datas
|
||||
AtLeast
|
||||
AtMost
|
||||
compiletime
|
||||
tring
|
||||
trings
|
||||
strat
|
||||
@@ -214,7 +214,7 @@ SubscribeHandler::subscribeToBooks(
|
||||
auto const [offers, _] =
|
||||
sharedPtrBackend_->fetchBookOffers(bookBase, rng->maxSequence, kFETCH_LIMIT, yield);
|
||||
|
||||
// the taker is not really uesed, same issue with
|
||||
// the taker is not really used, same issue with
|
||||
// https://github.com/XRPLF/xrpl-dev-portal/issues/1818
|
||||
auto const takerID = internalBook.taker ? accountFromStringStrict(*(internalBook.taker)) : beast::zero;
|
||||
|
||||
|
||||
@@ -159,7 +159,7 @@ public:
|
||||
/**
|
||||
* @brief Specialization for a nop/null decorator.
|
||||
*
|
||||
* This generates a pass-thru decorate member function which can be optimized away by the compiler.
|
||||
* This generates a pass-through decorate member function which can be optimized away by the compiler.
|
||||
*/
|
||||
template <>
|
||||
class TagDecorator<impl::NullTagGenerator> final : public BaseTagDecorator {
|
||||
|
||||
@@ -32,7 +32,7 @@ There are multiple execution contexts to choose from, each with their own pros a
|
||||
|
||||
This context wraps a thread pool and executes blocks of code by means of `boost::asio::spawn` which spawns coroutines.
|
||||
|
||||
Deep inside the framework it hides `boost::asio::yield_context` and automatically switches coroutine contexts everytime user’s code is checking `isStopRequested()` on the `StopToken` given to the user-provided lambda.
|
||||
Deep inside the framework it hides `boost::asio::yield_context` and automatically switches coroutine contexts every time user’s code is checking `isStopRequested()` on the `StopToken` given to the user-provided lambda.
|
||||
|
||||
The benefit is that both timers and async operations can work concurrently on a `CoroExecutionContext` even if internally the thread pool only has 1 thread.
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ public:
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief A helper function that is called when any error ocurs.
|
||||
* @brief A helper function that is called when any error occurs.
|
||||
*
|
||||
* @param ec The error code
|
||||
* @param message The message to include in the log
|
||||
|
||||
@@ -236,7 +236,7 @@ public:
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Accept the session asynchroniously
|
||||
* @brief Accept the session asynchronously
|
||||
*/
|
||||
void
|
||||
run(http::request<http::string_body> req)
|
||||
|
||||
@@ -292,7 +292,7 @@ TEST_F(RPCLedgerHandlerTest, Default)
|
||||
auto const req = json::parse("{}");
|
||||
auto output = handler.process(req, Context{yield});
|
||||
ASSERT_TRUE(output);
|
||||
// remove human readable time, it is sightly different cross the platform
|
||||
// remove human readable time, it is slightly different cross the platform
|
||||
EXPECT_EQ(output.result->as_object().at("ledger").as_object().erase("close_time_human"), 1);
|
||||
EXPECT_EQ(*output.result, json::parse(kEXPECTED_OUT));
|
||||
});
|
||||
@@ -562,7 +562,7 @@ TEST_F(RPCLedgerHandlerTest, TransactionsExpandNotBinary)
|
||||
);
|
||||
auto output = handler.process(req, Context{yield});
|
||||
ASSERT_TRUE(output);
|
||||
// remove human readable time, it is sightly different cross the platform
|
||||
// remove human readable time, it is slightly different cross the platform
|
||||
EXPECT_EQ(output.result->as_object().at("ledger").as_object().erase("close_time_human"), 1);
|
||||
EXPECT_EQ(*output.result, json::parse(kEXPECTED_OUT));
|
||||
});
|
||||
@@ -660,7 +660,7 @@ TEST_F(RPCLedgerHandlerTest, TransactionsExpandNotBinaryV2)
|
||||
);
|
||||
auto output = handler.process(req, Context{.yield = yield, .apiVersion = 2u});
|
||||
ASSERT_TRUE(output);
|
||||
// remove human readable time, it is sightly different cross the platform
|
||||
// remove human readable time, it is slightly different cross the platform
|
||||
EXPECT_EQ(output.result->as_object().at("ledger").as_object().erase("close_time_human"), 1);
|
||||
EXPECT_EQ(*output.result, json::parse(kEXPECTED_OUT));
|
||||
});
|
||||
@@ -923,7 +923,7 @@ TEST_F(RPCLedgerHandlerTest, OwnerFundsEmpty)
|
||||
);
|
||||
auto output = handler.process(req, Context{yield});
|
||||
ASSERT_TRUE(output);
|
||||
// remove human readable time, it is sightly different cross the platform
|
||||
// remove human readable time, it is slightly different cross the platform
|
||||
EXPECT_EQ(output.result->as_object().at("ledger").as_object().erase("close_time_human"), 1);
|
||||
EXPECT_EQ(*output.result, json::parse(kEXPECTED_OUT));
|
||||
});
|
||||
@@ -1031,7 +1031,7 @@ TEST_F(RPCLedgerHandlerTest, OwnerFundsTrueBinaryFalse)
|
||||
);
|
||||
auto output = handler.process(req, Context{yield});
|
||||
ASSERT_TRUE(output);
|
||||
// remove human readable time, it is sightly different cross the platform
|
||||
// remove human readable time, it is slightly different cross the platform
|
||||
EXPECT_EQ(output.result->as_object().at("ledger").as_object().erase("close_time_human"), 1);
|
||||
EXPECT_EQ(*output.result, json::parse(kEXPECTED_OUT));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user