File tree 5 files changed +39
-4
lines changed
5 files changed +39
-4
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,12 @@ emacs internals/program/hello.cpp &
64
64
cppsm test-watch
65
65
```
66
66
67
+ Format project files inplace:
68
+
69
+ ``` bash
70
+ cppsm format
71
+ ```
72
+
67
73
Clone an existing project:
68
74
69
75
``` bash
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ __cppsm_complete() {
10
10
case " $PREVIOUS " in
11
11
cppsm)
12
12
# shellcheck disable=SC2207
13
- COMPREPLY=($( compgen -W " add build build-watch clone hello init list remove setup test test-watch update-all" -- " $CURRENT " ) )
13
+ COMPREPLY=($( compgen -W " add build build-watch clone format hello init list remove setup test test-watch update-all" -- " $CURRENT " ) )
14
14
;;
15
15
add)
16
16
# shellcheck disable=SC2207
Original file line number Diff line number Diff line change
1
+ #! /bin/bash -e
2
+
3
+ # shellcheck source=.settings
4
+ . " ${BASH_SOURCE%/* } /.settings"
5
+
6
+ if [ " $# " -ne 0 ] || [ ! -d .git ] ; then
7
+ CMD=" ${0##*/ } "
8
+ cat << EOF
9
+ Usage: $CMD
10
+
11
+ Formats project files inplace using
12
+ - clang-format ( https://clang.llvm.org/docs/ClangFormat.html ), and
13
+ - prettier ( https://prettier.io/ ).
14
+ EOF
15
+ exit 1
16
+ fi
17
+
18
+ for ROOT in provides internals ; do
19
+ find $ROOT -name ' *.md' -print0 | xargs -0 prettier --write --
20
+ for SUFFIX in cpp hpp ; do
21
+ find $ROOT -name " *.$SUFFIX " -print0 | xargs -0 clang-format -i --
22
+ done
23
+ done
24
+
25
+ find . -name ' *.md' -maxdepth 1 -print0 | xargs -0 prettier --write --
Original file line number Diff line number Diff line change @@ -56,9 +56,8 @@ cat << EOF > internals/testing/message_test.cpp
56
56
57
57
using namespace testing_v1;
58
58
59
- auto hello_test = test([]() {
60
- verify("Hello, there!" == message_v1::hello("there"));
61
- });
59
+ auto hello_test =
60
+ test([]() { verify("Hello, there!" == message_v1::hello("there")); });
62
61
EOF
63
62
64
63
mkdir -p internals/program
Original file line number Diff line number Diff line change @@ -8,6 +8,11 @@ git init
8
8
cppsm init
9
9
cppsm hello
10
10
11
+ git add internals provides
12
+ git config --global user.email
" [email protected] "
13
+ git config --global user.name " CI script"
14
+ git commit -m Initial
15
+
11
16
.cppsm/travis-ci
12
17
13
18
git submodule add -b v1 https://github.com/per-framework/dumpster.cpp.git equipment/dumpster.cpp/v1
You can’t perform that action at this time.
0 commit comments