Skip to content

Commit ca872b0

Browse files
committed
build: add standard white-space pre-commit hooks
1 parent 2bb55dc commit ca872b0

File tree

169 files changed

+242
-247
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

169 files changed

+242
-247
lines changed

.clang-format

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ BasedOnStyle: Google
33

44
# Customize with larger indents
55
IndentWidth: 4
6-
ObjCBlockIndentWidth: 4
6+
ObjCBlockIndentWidth: 4

.github/workflows/ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,3 @@ jobs:
8888
cmake .
8989
cmake --build . -- test_hello-world
9090
cmake --build .
91-

.github/workflows/hello-world.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ jobs:
2525
- name: Check Hello World Fails
2626
run: bin/check-hello-world.sh
2727
env:
28-
CXX: ${{ matrix.compiler }}
28+
CXX: ${{ matrix.compiler }}

.pre-commit-config.yaml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
1-
exclude: 'test/(catch(_amalgamated)?.[ch]pp|tests-main.cpp)'
1+
exclude: |
2+
(?x)^(
3+
(.*/)?test/(catch(_amalgamated)?.[ch]pp|tests-main.cpp)|
4+
.github/CODEOWNERS
5+
)$
26
37
repos:
8+
- repo: https://github.com/pre-commit/pre-commit-hooks
9+
rev: v5.0.0
10+
hooks:
11+
- id: trailing-whitespace
12+
- id: end-of-file-fixer
13+
- id: check-yaml
14+
- id: check-added-large-files
415
- repo: https://github.com/pre-commit/mirrors-clang-format
516
rev: v18.1.2
617
hooks:
718
- id: clang-format
819
exclude_types: [json]
9-

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,4 @@
7272
"cSpell.words": [
7373
"stationprogress"
7474
]
75-
}
75+
}

bin/check-hello-world.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ if cmake --build .; then
2525
exit 1
2626
fi
2727

28-
cd "$repo"
28+
cd "$repo"

concepts/auto/links.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
"url": "https://www.learncpp.com/cpp-tutorial/type-deduction-for-objects-using-the-auto-keyword/",
88
"description": "Learn C++ overview on the auto keyword and its usage"
99
}
10-
]
10+
]

concepts/basics/about.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ To set off the C++ journey we are starting with variables, function calls, and c
66

77
Comments come in two flavors: single- and multi-line.
88
Everything that comes after `//` on the same line is ignored by the compiler.
9-
Multi-line comments are also known as C-style comments.
9+
Multi-line comments are also known as C-style comments.
1010
They are surrounded by `/*` and `*/`.
1111
Anything that comes between these will be ignored as well.
1212

@@ -40,7 +40,7 @@ It cannot be stressed enough: avoid undefined behavior at all cost.
4040
4141
## Arithmetic Operations
4242
43-
Arithmetic operators like `*`, `+`, or `-` can be part of an expression like `3 * 2` or `tomatoes + potatoes`.
43+
Arithmetic operators like `*`, `+`, or `-` can be part of an expression like `3 * 2` or `tomatoes + potatoes`.
4444
4545
## Updating Variables
4646
@@ -84,7 +84,7 @@ int total_fee(int vips, int adults, int kids) {
8484
*/
8585
int standard_fee{30};
8686
int kids_discount{15};
87-
87+
8888
int kids_total_fee = kids * (standard_fee - kids_discount);
8989
int vips_total_fee = vips * vip_fee(standard_fee);
9090
int adult_total_fee = adults * standard_fee;

concepts/basics/introduction.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ To set off the C++ journey we are starting with variables, function calls, and c
66

77
Comments come in two flavors: single- and multi-line.
88
Everything that comes after `//` on the same line is ignored by the compiler.
9-
Multi-line comments are also known as C-style comments.
9+
Multi-line comments are also known as C-style comments.
1010
They are surrounded by `/*` and `*/`.
1111
Anything that comes between these will be ignored as well.
1212

@@ -40,7 +40,7 @@ It cannot be stressed enough: avoid undefined behavior at all cost.
4040
4141
## Arithmetic Operations
4242
43-
Arithmetic operators like `*`, `+`, or `-` can be part of an expression like `3 * 2` or `tomatoes + potatoes`.
43+
Arithmetic operators like `*`, `+`, or `-` can be part of an expression like `3 * 2` or `tomatoes + potatoes`.
4444
4545
## Updating Variables
4646
@@ -84,7 +84,7 @@ int total_fee(int vips, int adults, int kids) {
8484
*/
8585
int standard_fee{30};
8686
int kids_discount{15};
87-
87+
8888
int kids_total_fee = kids * (standard_fee - kids_discount);
8989
int vips_total_fee = vips * vip_fee(standard_fee);
9090
int adult_total_fee = adults * standard_fee;

concepts/basics/links.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@
1111
"url": "https://isocpp.org/faq",
1212
"description": "C++ Super-FAQ"
1313
}
14-
]
14+
]

0 commit comments

Comments
 (0)