From 3b95b9440667ef49d43bcd35f0e00375641c8049 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Wed, 29 Sep 2021 06:15:48 -0400 Subject: [PATCH] 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> --- .github/workflows/tests.yml | 8 -------- .pre-commit-config.yaml | 15 +++------------ include/CLI/App.hpp | 8 ++++---- include/CLI/Option.hpp | 2 +- include/CLI/Validators.hpp | 12 ++++++------ 5 files changed, 14 insertions(+), 31 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0ad316b4..e962861f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 00d77d22..05b6bf28 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 diff --git a/include/CLI/App.hpp b/include/CLI/App.hpp index 03b58d9f..9d3b3c3e 100644 --- a/include/CLI/App.hpp +++ b/include/CLI/App.hpp @@ -3169,25 +3169,25 @@ struct AppFriend { #ifdef CLI11_CPP14 /// Wrap _parse_short, perfectly forward arguments and return - template static decltype(auto) parse_arg(App *app, Args &&... args) { + template static decltype(auto) parse_arg(App *app, Args &&...args) { return app->_parse_arg(std::forward(args)...); } /// Wrap _parse_subcommand, perfectly forward arguments and return - template static decltype(auto) parse_subcommand(App *app, Args &&... args) { + template static decltype(auto) parse_subcommand(App *app, Args &&...args) { return app->_parse_subcommand(std::forward(args)...); } #else /// Wrap _parse_short, perfectly forward arguments and return template - static auto parse_arg(App *app, Args &&... args) -> + static auto parse_arg(App *app, Args &&...args) -> typename std::result_of::type { return app->_parse_arg(std::forward(args)...); } /// Wrap _parse_subcommand, perfectly forward arguments and return template - static auto parse_subcommand(App *app, Args &&... args) -> + static auto parse_subcommand(App *app, Args &&...args) -> typename std::result_of::type { return app->_parse_subcommand(std::forward(args)...); } diff --git a/include/CLI/Option.hpp b/include/CLI/Option.hpp index 616cd120..25a67605 100644 --- a/include/CLI/Option.hpp +++ b/include/CLI/Option.hpp @@ -781,7 +781,7 @@ class Option : public OptionBase