Skip to content

Commit 3b95b94

Browse files
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>
1 parent 81b092e commit 3b95b94

File tree

5 files changed

+14
-31
lines changed

5 files changed

+14
-31
lines changed

.github/workflows/tests.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,6 @@ on:
99
- master
1010

1111
jobs:
12-
pre-commit:
13-
name: Formatting
14-
runs-on: ubuntu-latest
15-
steps:
16-
- uses: actions/checkout@v2
17-
- uses: actions/setup-python@v2
18-
- uses: pre-commit/[email protected]
19-
2012
cuda-build:
2113
name: CUDA build only
2214
runs-on: ubuntu-latest

.pre-commit-config.yaml

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
ci:
22
autoupdate_commit_msg: "chore(deps): pre-commit.ci autoupdate"
33
autofix_commit_msg: "style: pre-commit.ci fixes"
4-
skip:
5-
- docker-clang-format
64

75

86
repos:
@@ -23,17 +21,10 @@ repos:
2321
- id: mixed-line-ending
2422
- id: trailing-whitespace
2523

26-
- repo: local
24+
- repo: https://github.com/ssciwr/clang-format-hook
25+
rev: v12.0.1
2726
hooks:
28-
- id: docker-clang-format
29-
name: Docker Clang Format
30-
language: docker_image
31-
types:
32-
- c++
33-
entry: unibeautify/clang-format:latest
34-
args:
35-
- -style=file
36-
- -i
27+
- id: clang-format
3728

3829
- repo: https://github.com/cheshirekow/cmake-format-precommit
3930
rev: v0.6.13

include/CLI/App.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3169,25 +3169,25 @@ struct AppFriend {
31693169
#ifdef CLI11_CPP14
31703170

31713171
/// Wrap _parse_short, perfectly forward arguments and return
3172-
template <typename... Args> static decltype(auto) parse_arg(App *app, Args &&... args) {
3172+
template <typename... Args> static decltype(auto) parse_arg(App *app, Args &&...args) {
31733173
return app->_parse_arg(std::forward<Args>(args)...);
31743174
}
31753175

31763176
/// Wrap _parse_subcommand, perfectly forward arguments and return
3177-
template <typename... Args> static decltype(auto) parse_subcommand(App *app, Args &&... args) {
3177+
template <typename... Args> static decltype(auto) parse_subcommand(App *app, Args &&...args) {
31783178
return app->_parse_subcommand(std::forward<Args>(args)...);
31793179
}
31803180
#else
31813181
/// Wrap _parse_short, perfectly forward arguments and return
31823182
template <typename... Args>
3183-
static auto parse_arg(App *app, Args &&... args) ->
3183+
static auto parse_arg(App *app, Args &&...args) ->
31843184
typename std::result_of<decltype (&App::_parse_arg)(App, Args...)>::type {
31853185
return app->_parse_arg(std::forward<Args>(args)...);
31863186
}
31873187

31883188
/// Wrap _parse_subcommand, perfectly forward arguments and return
31893189
template <typename... Args>
3190-
static auto parse_subcommand(App *app, Args &&... args) ->
3190+
static auto parse_subcommand(App *app, Args &&...args) ->
31913191
typename std::result_of<decltype (&App::_parse_subcommand)(App, Args...)>::type {
31923192
return app->_parse_subcommand(std::forward<Args>(args)...);
31933193
}

include/CLI/Option.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,7 @@ class Option : public OptionBase<Option> {
781781
/// Use `get_name(true)` to get the positional name (replaces `get_pname`)
782782
std::string get_name(bool positional = false, ///< Show the positional name
783783
bool all_options = false ///< Show every option
784-
) const {
784+
) const {
785785
if(get_group().empty())
786786
return {}; // Hidden
787787

include/CLI/Validators.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ class IsMember : public Validator {
676676

677677
/// This allows in-place construction using an initializer list
678678
template <typename T, typename... Args>
679-
IsMember(std::initializer_list<T> values, Args &&... args)
679+
IsMember(std::initializer_list<T> values, Args &&...args)
680680
: IsMember(std::vector<T>(values), std::forward<Args>(args)...) {}
681681

682682
/// This checks to see if an item is in a set (empty function)
@@ -728,7 +728,7 @@ class IsMember : public Validator {
728728

729729
/// You can pass in as many filter functions as you like, they nest (string only currently)
730730
template <typename T, typename... Args>
731-
IsMember(T &&set, filter_fn_t filter_fn_1, filter_fn_t filter_fn_2, Args &&... other)
731+
IsMember(T &&set, filter_fn_t filter_fn_1, filter_fn_t filter_fn_2, Args &&...other)
732732
: IsMember(
733733
std::forward<T>(set),
734734
[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 {
745745

746746
/// This allows in-place construction
747747
template <typename... Args>
748-
Transformer(std::initializer_list<std::pair<std::string, std::string>> values, Args &&... args)
748+
Transformer(std::initializer_list<std::pair<std::string, std::string>> values, Args &&...args)
749749
: Transformer(TransformPairs<std::string>(values), std::forward<Args>(args)...) {}
750750

751751
/// direct map of std::string to std::string
@@ -789,7 +789,7 @@ class Transformer : public Validator {
789789

790790
/// You can pass in as many filter functions as you like, they nest
791791
template <typename T, typename... Args>
792-
Transformer(T &&mapping, filter_fn_t filter_fn_1, filter_fn_t filter_fn_2, Args &&... other)
792+
Transformer(T &&mapping, filter_fn_t filter_fn_1, filter_fn_t filter_fn_2, Args &&...other)
793793
: Transformer(
794794
std::forward<T>(mapping),
795795
[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 {
803803

804804
/// This allows in-place construction
805805
template <typename... Args>
806-
CheckedTransformer(std::initializer_list<std::pair<std::string, std::string>> values, Args &&... args)
806+
CheckedTransformer(std::initializer_list<std::pair<std::string, std::string>> values, Args &&...args)
807807
: CheckedTransformer(TransformPairs<std::string>(values), std::forward<Args>(args)...) {}
808808

809809
/// direct map of std::string to std::string
@@ -865,7 +865,7 @@ class CheckedTransformer : public Validator {
865865

866866
/// You can pass in as many filter functions as you like, they nest
867867
template <typename T, typename... Args>
868-
CheckedTransformer(T &&mapping, filter_fn_t filter_fn_1, filter_fn_t filter_fn_2, Args &&... other)
868+
CheckedTransformer(T &&mapping, filter_fn_t filter_fn_1, filter_fn_t filter_fn_2, Args &&...other)
869869
: CheckedTransformer(
870870
std::forward<T>(mapping),
871871
[filter_fn_1, filter_fn_2](std::string a) { return filter_fn_2(filter_fn_1(a)); },

0 commit comments

Comments
 (0)