Skip to content

Commit ff43a43

Browse files
authored
Merge pull request #23 from WATonomous/add-pre-commit
Add pre-commit
2 parents 895e2a2 + 4ba4a19 commit ff43a43

File tree

196 files changed

+28381
-22890
lines changed

Some content is hidden

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

196 files changed

+28381
-22890
lines changed

.config/.yamllint.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
extends: default
3+
4+
rules:
5+
line-length:
6+
max: 256
7+
commas: false
8+
9+
truthy:
10+
ignore: |
11+
.github/workflows/build_base_images.yml
12+
.github/workflows/build_and_unitest.yml

.config/clang-format

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
---
2+
# C++ Formatting rules for WATonomous Standard
3+
4+
# See https://releases.llvm.org/14.0.0/tools/clang/docs/ClangFormatStyleOptions.html for documentation of these options
5+
BasedOnStyle: Google
6+
IndentWidth: 2
7+
ColumnLimit: 120
8+
9+
AccessModifierOffset: -2
10+
AlignAfterOpenBracket: AlwaysBreak
11+
AlignConsecutiveAssignments: None
12+
AlignConsecutiveDeclarations: None
13+
AlignEscapedNewlines: Left
14+
AlignTrailingComments: false
15+
AllowAllArgumentsOnNextLine: true
16+
AllowAllParametersOfDeclarationOnNextLine: true
17+
AllowShortBlocksOnASingleLine: Empty
18+
AllowShortFunctionsOnASingleLine: false
19+
BinPackArguments: false
20+
BinPackParameters: false
21+
BraceWrapping:
22+
AfterClass: true
23+
AfterControlStatement: MultiLine
24+
AfterEnum: true
25+
AfterFunction: true
26+
AfterNamespace: true
27+
AfterStruct: true
28+
AfterUnion: true
29+
AfterExternBlock: true
30+
BeforeCatch: false
31+
BeforeElse: false
32+
BeforeLambdaBody: false
33+
BeforeWhile: false
34+
IndentBraces: false
35+
SplitEmptyFunction: false
36+
SplitEmptyRecord: false
37+
SplitEmptyNamespace: false
38+
BreakBeforeBraces: Custom
39+
BreakConstructorInitializers: BeforeComma
40+
CompactNamespaces: false
41+
ContinuationIndentWidth: 2
42+
ConstructorInitializerIndentWidth: 0
43+
DerivePointerAlignment: false
44+
EmptyLineAfterAccessModifier: Never
45+
EmptyLineBeforeAccessModifier: LogicalBlock
46+
FixNamespaceComments: true
47+
IncludeBlocks: Regroup
48+
IncludeCategories:
49+
# Headers in <> with .h extension (best guess at C system headers)
50+
- Regex: '<([A-Za-z0-9\Q/-_\E])+\.h>'
51+
Priority: 1
52+
# Headers in <> without extension (C++ system headers)
53+
- Regex: '<([A-Za-z0-9\Q/-_\E])+>'
54+
Priority: 2
55+
# Headers in <> with other extensions.
56+
- Regex: '<([A-Za-z0-9.\Q/-_\E])+>'
57+
Priority: 3
58+
# Headers in ""
59+
- Regex: '"([A-Za-z0-9.\Q/-_\E])+"'
60+
Priority: 4
61+
IndentAccessModifiers: false
62+
IndentPPDirectives: BeforeHash
63+
PackConstructorInitializers: Never
64+
PointerAlignment: Middle
65+
ReferenceAlignment: Middle
66+
ReflowComments: false
67+
SeparateDefinitionBlocks: Always
68+
SortIncludes: CaseInsensitive
69+
SpacesBeforeTrailingComments: 2

.config/copyright.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Copyright (c) 2025-present WATonomous. All rights reserved.
2+
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License.

.cpplint.cfg

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Because of cpplint's config file assumptions, this can't be contained in .config/ directory
2+
linelength=256
3+
4+
filter=-legal/copyright
5+
filter=-build/header_guard
6+
filter=-build/c++17
7+
8+
# Disable all formatting checks, this is handled by clang-format
9+
filter=-readability/braces
10+
filter=-whitespace/braces
11+
filter=-whitespace/indent
12+
filter=-whitespace/newline
13+
filter=-whitespace/parens
14+
filter=-whitespace/semicolon

.github/workflows/pre-commit.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: Pre-commit
3+
4+
on:
5+
pull_request:
6+
push:
7+
branches: [main]
8+
9+
jobs:
10+
run-pre-commit:
11+
name: Pre-commit Check
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- uses: actions/setup-python@v5
18+
with:
19+
python-version: '3.x'
20+
21+
- name: Install xmllint dependency
22+
run: |
23+
sudo apt-get update -qq
24+
sudo apt-get install -y --no-install-recommends libxml2-utils
25+
26+
- name: Install pre-commit
27+
run: |
28+
python -m pip install --upgrade pip
29+
pip install pre-commit
30+
31+
- name: Run pre-commit hooks
32+
run: pre-commit run --all-files

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ __pycache__
55

66
watod-config.local.sh
77
**/.DS_Store
8-
draft_*
8+
draft_*

.idea/.gitignore

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/editor.xml

Lines changed: 344 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)