1
0
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:
Henry Schreiner 2021-09-29 06:15:48 -04:00 committed by GitHub
parent 81b092e085
commit 3b95b94406
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 14 additions and 31 deletions

View File

@ -9,14 +9,6 @@ on:
- master - master
jobs: 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: cuda-build:
name: CUDA build only name: CUDA build only
runs-on: ubuntu-latest runs-on: ubuntu-latest

View File

@ -1,8 +1,6 @@
ci: ci:
autoupdate_commit_msg: "chore(deps): pre-commit.ci autoupdate" autoupdate_commit_msg: "chore(deps): pre-commit.ci autoupdate"
autofix_commit_msg: "style: pre-commit.ci fixes" autofix_commit_msg: "style: pre-commit.ci fixes"
skip:
- docker-clang-format
repos: repos:
@ -23,17 +21,10 @@ repos:
- id: mixed-line-ending - id: mixed-line-ending
- id: trailing-whitespace - id: trailing-whitespace
- repo: local - repo: https://github.com/ssciwr/clang-format-hook
rev: v12.0.1
hooks: hooks:
- id: docker-clang-format - id: clang-format
name: Docker Clang Format
language: docker_image
types:
- c++
entry: unibeautify/clang-format:latest
args:
- -style=file
- -i
- repo: https://github.com/cheshirekow/cmake-format-precommit - repo: https://github.com/cheshirekow/cmake-format-precommit
rev: v0.6.13 rev: v0.6.13

View File

@ -3169,25 +3169,25 @@ struct AppFriend {
#ifdef CLI11_CPP14 #ifdef CLI11_CPP14
/// Wrap _parse_short, perfectly forward arguments and return /// 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)...); return app->_parse_arg(std::forward<Args>(args)...);
} }
/// Wrap _parse_subcommand, perfectly forward arguments and return /// 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)...); return app->_parse_subcommand(std::forward<Args>(args)...);
} }
#else #else
/// Wrap _parse_short, perfectly forward arguments and return /// Wrap _parse_short, perfectly forward arguments and return
template <typename... Args> 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 { typename std::result_of<decltype (&App::_parse_arg)(App, Args...)>::type {
return app->_parse_arg(std::forward<Args>(args)...); return app->_parse_arg(std::forward<Args>(args)...);
} }
/// Wrap _parse_subcommand, perfectly forward arguments and return /// Wrap _parse_subcommand, perfectly forward arguments and return
template <typename... Args> 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 { typename std::result_of<decltype (&App::_parse_subcommand)(App, Args...)>::type {
return app->_parse_subcommand(std::forward<Args>(args)...); return app->_parse_subcommand(std::forward<Args>(args)...);
} }

View File

@ -676,7 +676,7 @@ class IsMember : public Validator {
/// This allows in-place construction using an initializer list /// This allows in-place construction using an initializer list
template <typename T, typename... Args> 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)...) {} : IsMember(std::vector<T>(values), std::forward<Args>(args)...) {}
/// This checks to see if an item is in a set (empty function) /// 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) /// You can pass in as many filter functions as you like, they nest (string only currently)
template <typename T, typename... Args> 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( : IsMember(
std::forward<T>(set), std::forward<T>(set),
[filter_fn_1, filter_fn_2](std::string a) { return filter_fn_2(filter_fn_1(a)); }, [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 /// This allows in-place construction
template <typename... Args> 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)...) {} : Transformer(TransformPairs<std::string>(values), std::forward<Args>(args)...) {}
/// direct map of std::string to std::string /// 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 /// You can pass in as many filter functions as you like, they nest
template <typename T, typename... Args> 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( : Transformer(
std::forward<T>(mapping), std::forward<T>(mapping),
[filter_fn_1, filter_fn_2](std::string a) { return filter_fn_2(filter_fn_1(a)); }, [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 /// This allows in-place construction
template <typename... Args> 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)...) {} : CheckedTransformer(TransformPairs<std::string>(values), std::forward<Args>(args)...) {}
/// direct map of std::string to std::string /// 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 /// You can pass in as many filter functions as you like, they nest
template <typename T, typename... Args> 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( : CheckedTransformer(
std::forward<T>(mapping), std::forward<T>(mapping),
[filter_fn_1, filter_fn_2](std::string a) { return filter_fn_2(filter_fn_1(a)); }, [filter_fn_1, filter_fn_2](std::string a) { return filter_fn_2(filter_fn_1(a)); },