File tree Expand file tree Collapse file tree 5 files changed +39
-4
lines changed
Expand file tree Collapse file tree 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 &
6464cppsm test-watch
6565```
6666
67+ Format project files inplace:
68+
69+ ``` bash
70+ cppsm format
71+ ```
72+
6773Clone an existing project:
6874
6975``` bash
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ __cppsm_complete() {
1010 case " $PREVIOUS " in
1111 cppsm)
1212 # 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 " ) )
1414 ;;
1515 add)
1616 # 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
5656
5757using namespace testing_v1;
5858
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")); });
6261EOF
6362
6463mkdir -p internals/program
Original file line number Diff line number Diff line change @@ -8,6 +8,11 @@ git init
88cppsm init
99cppsm hello
1010
11+ git add internals provides
12+ git config --global user.email " ci@script.com"
13+ git config --global user.name " CI script"
14+ git commit -m Initial
15+
1116.cppsm/travis-ci
1217
1318git 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