mirror of
https://github.com/KeqingMoe/argparse.git
synced 2025-07-03 22:54:39 +00:00
Enable clang-tidy readability-named-parameter check
Adds names recommended by clang-tidy (e.g. "unused"). Note that clang-tidy v12 appears to detect unnamed parameters in lambdas, while clang-tidy v13 does not. Signed-off-by: Sean Robinson <sean.robinson@scottsdalecc.edu>
This commit is contained in:
parent
9eb1fe5cef
commit
b5fb663bc8
@ -3,7 +3,6 @@ Checks:
|
|||||||
readability-*,
|
readability-*,
|
||||||
-readability-else-after-return,
|
-readability-else-after-return,
|
||||||
-readability-function-cognitive-complexity,
|
-readability-function-cognitive-complexity,
|
||||||
-readability-named-parameter,
|
|
||||||
-readability-qualified-auto,
|
-readability-qualified-auto,
|
||||||
-readability-static-accessed-through-instance,
|
-readability-static-accessed-through-instance,
|
||||||
|
|
||||||
|
@ -150,7 +150,7 @@ constexpr bool standard_integer =
|
|||||||
|
|
||||||
template <class F, class Tuple, class Extra, std::size_t... I>
|
template <class F, class Tuple, class Extra, std::size_t... I>
|
||||||
constexpr decltype(auto) apply_plus_one_impl(F &&f, Tuple &&t, Extra &&x,
|
constexpr decltype(auto) apply_plus_one_impl(F &&f, Tuple &&t, Extra &&x,
|
||||||
std::index_sequence<I...>) {
|
std::index_sequence<I...> unused) {
|
||||||
return std::invoke(std::forward<F>(f), std::get<I>(std::forward<Tuple>(t))...,
|
return std::invoke(std::forward<F>(f), std::get<I>(std::forward<Tuple>(t))...,
|
||||||
std::forward<Extra>(x));
|
std::forward<Extra>(x));
|
||||||
}
|
}
|
||||||
@ -347,11 +347,11 @@ class ArgumentParser;
|
|||||||
|
|
||||||
class Argument {
|
class Argument {
|
||||||
friend class ArgumentParser;
|
friend class ArgumentParser;
|
||||||
friend auto operator<<(std::ostream &, ArgumentParser const &)
|
friend auto operator<<(std::ostream &stream, const ArgumentParser &parser)
|
||||||
-> std::ostream &;
|
-> std::ostream &;
|
||||||
|
|
||||||
template <std::size_t N, std::size_t... I>
|
template <std::size_t N, std::size_t... I>
|
||||||
explicit Argument(std::string_view(&&a)[N], std::index_sequence<I...>)
|
explicit Argument(std::string_view(&&a)[N], std::index_sequence<I...> unused)
|
||||||
: mIsOptional((is_optional(a[I]) || ...)), mIsRequired(false),
|
: mIsOptional((is_optional(a[I]) || ...)), mIsRequired(false),
|
||||||
mIsRepeatable(false), mIsUsed(false) {
|
mIsRepeatable(false), mIsUsed(false) {
|
||||||
((void)mNames.emplace_back(a[I]), ...);
|
((void)mNames.emplace_back(a[I]), ...);
|
||||||
@ -866,7 +866,7 @@ public:
|
|||||||
: mProgramName(std::move(aProgramName)), mVersion(std::move(aVersion)) {
|
: mProgramName(std::move(aProgramName)), mVersion(std::move(aVersion)) {
|
||||||
if ((aArgs & default_arguments::help) == default_arguments::help) {
|
if ((aArgs & default_arguments::help) == default_arguments::help) {
|
||||||
add_argument("-h", "--help")
|
add_argument("-h", "--help")
|
||||||
.action([&](const auto &) {
|
.action([&](const auto &unused) {
|
||||||
std::cout << help().str();
|
std::cout << help().str();
|
||||||
std::exit(0);
|
std::exit(0);
|
||||||
})
|
})
|
||||||
@ -877,7 +877,7 @@ public:
|
|||||||
}
|
}
|
||||||
if ((aArgs & default_arguments::version) == default_arguments::version) {
|
if ((aArgs & default_arguments::version) == default_arguments::version) {
|
||||||
add_argument("-v", "--version")
|
add_argument("-v", "--version")
|
||||||
.action([&](const auto &) {
|
.action([&](const auto &unused) {
|
||||||
std::cout << mVersion;
|
std::cout << mVersion;
|
||||||
std::exit(0);
|
std::exit(0);
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user