mirror of
https://github.com/CLIUtils/CLI11.git
synced 2025-04-30 12:43:52 +00:00
chore: use PyPI clang-format package, pinned (#647)
* chore: use PyPI clang-format package, pinned * style: pre-commit.ci fixes * ci: drop unneeded job Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
81b092e085
commit
3b95b94406
8
.github/workflows/tests.yml
vendored
8
.github/workflows/tests.yml
vendored
@ -9,14 +9,6 @@ on:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
pre-commit:
|
||||
name: Formatting
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-python@v2
|
||||
- uses: pre-commit/action@v2.0.3
|
||||
|
||||
cuda-build:
|
||||
name: CUDA build only
|
||||
runs-on: ubuntu-latest
|
||||
|
@ -1,8 +1,6 @@
|
||||
ci:
|
||||
autoupdate_commit_msg: "chore(deps): pre-commit.ci autoupdate"
|
||||
autofix_commit_msg: "style: pre-commit.ci fixes"
|
||||
skip:
|
||||
- docker-clang-format
|
||||
|
||||
|
||||
repos:
|
||||
@ -23,17 +21,10 @@ repos:
|
||||
- id: mixed-line-ending
|
||||
- id: trailing-whitespace
|
||||
|
||||
- repo: local
|
||||
- repo: https://github.com/ssciwr/clang-format-hook
|
||||
rev: v12.0.1
|
||||
hooks:
|
||||
- id: docker-clang-format
|
||||
name: Docker Clang Format
|
||||
language: docker_image
|
||||
types:
|
||||
- c++
|
||||
entry: unibeautify/clang-format:latest
|
||||
args:
|
||||
- -style=file
|
||||
- -i
|
||||
- id: clang-format
|
||||
|
||||
- repo: https://github.com/cheshirekow/cmake-format-precommit
|
||||
rev: v0.6.13
|
||||
|
@ -3169,25 +3169,25 @@ struct AppFriend {
|
||||
#ifdef CLI11_CPP14
|
||||
|
||||
/// Wrap _parse_short, perfectly forward arguments and return
|
||||
template <typename... Args> static decltype(auto) parse_arg(App *app, Args &&... args) {
|
||||
template <typename... Args> static decltype(auto) parse_arg(App *app, Args &&...args) {
|
||||
return app->_parse_arg(std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
/// Wrap _parse_subcommand, perfectly forward arguments and return
|
||||
template <typename... Args> static decltype(auto) parse_subcommand(App *app, Args &&... args) {
|
||||
template <typename... Args> static decltype(auto) parse_subcommand(App *app, Args &&...args) {
|
||||
return app->_parse_subcommand(std::forward<Args>(args)...);
|
||||
}
|
||||
#else
|
||||
/// Wrap _parse_short, perfectly forward arguments and return
|
||||
template <typename... Args>
|
||||
static auto parse_arg(App *app, Args &&... args) ->
|
||||
static auto parse_arg(App *app, Args &&...args) ->
|
||||
typename std::result_of<decltype (&App::_parse_arg)(App, Args...)>::type {
|
||||
return app->_parse_arg(std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
/// Wrap _parse_subcommand, perfectly forward arguments and return
|
||||
template <typename... Args>
|
||||
static auto parse_subcommand(App *app, Args &&... args) ->
|
||||
static auto parse_subcommand(App *app, Args &&...args) ->
|
||||
typename std::result_of<decltype (&App::_parse_subcommand)(App, Args...)>::type {
|
||||
return app->_parse_subcommand(std::forward<Args>(args)...);
|
||||
}
|
||||
|
@ -676,7 +676,7 @@ class IsMember : public Validator {
|
||||
|
||||
/// This allows in-place construction using an initializer list
|
||||
template <typename T, typename... Args>
|
||||
IsMember(std::initializer_list<T> values, Args &&... args)
|
||||
IsMember(std::initializer_list<T> values, Args &&...args)
|
||||
: IsMember(std::vector<T>(values), std::forward<Args>(args)...) {}
|
||||
|
||||
/// This checks to see if an item is in a set (empty function)
|
||||
@ -728,7 +728,7 @@ class IsMember : public Validator {
|
||||
|
||||
/// You can pass in as many filter functions as you like, they nest (string only currently)
|
||||
template <typename T, typename... Args>
|
||||
IsMember(T &&set, filter_fn_t filter_fn_1, filter_fn_t filter_fn_2, Args &&... other)
|
||||
IsMember(T &&set, filter_fn_t filter_fn_1, filter_fn_t filter_fn_2, Args &&...other)
|
||||
: IsMember(
|
||||
std::forward<T>(set),
|
||||
[filter_fn_1, filter_fn_2](std::string a) { return filter_fn_2(filter_fn_1(a)); },
|
||||
@ -745,7 +745,7 @@ class Transformer : public Validator {
|
||||
|
||||
/// This allows in-place construction
|
||||
template <typename... Args>
|
||||
Transformer(std::initializer_list<std::pair<std::string, std::string>> values, Args &&... args)
|
||||
Transformer(std::initializer_list<std::pair<std::string, std::string>> values, Args &&...args)
|
||||
: Transformer(TransformPairs<std::string>(values), std::forward<Args>(args)...) {}
|
||||
|
||||
/// direct map of std::string to std::string
|
||||
@ -789,7 +789,7 @@ class Transformer : public Validator {
|
||||
|
||||
/// You can pass in as many filter functions as you like, they nest
|
||||
template <typename T, typename... Args>
|
||||
Transformer(T &&mapping, filter_fn_t filter_fn_1, filter_fn_t filter_fn_2, Args &&... other)
|
||||
Transformer(T &&mapping, filter_fn_t filter_fn_1, filter_fn_t filter_fn_2, Args &&...other)
|
||||
: Transformer(
|
||||
std::forward<T>(mapping),
|
||||
[filter_fn_1, filter_fn_2](std::string a) { return filter_fn_2(filter_fn_1(a)); },
|
||||
@ -803,7 +803,7 @@ class CheckedTransformer : public Validator {
|
||||
|
||||
/// This allows in-place construction
|
||||
template <typename... Args>
|
||||
CheckedTransformer(std::initializer_list<std::pair<std::string, std::string>> values, Args &&... args)
|
||||
CheckedTransformer(std::initializer_list<std::pair<std::string, std::string>> values, Args &&...args)
|
||||
: CheckedTransformer(TransformPairs<std::string>(values), std::forward<Args>(args)...) {}
|
||||
|
||||
/// direct map of std::string to std::string
|
||||
@ -865,7 +865,7 @@ class CheckedTransformer : public Validator {
|
||||
|
||||
/// You can pass in as many filter functions as you like, they nest
|
||||
template <typename T, typename... Args>
|
||||
CheckedTransformer(T &&mapping, filter_fn_t filter_fn_1, filter_fn_t filter_fn_2, Args &&... other)
|
||||
CheckedTransformer(T &&mapping, filter_fn_t filter_fn_1, filter_fn_t filter_fn_2, Args &&...other)
|
||||
: CheckedTransformer(
|
||||
std::forward<T>(mapping),
|
||||
[filter_fn_1, filter_fn_2](std::string a) { return filter_fn_2(filter_fn_1(a)); },
|
||||
|
Loading…
x
Reference in New Issue
Block a user