Skip to content

Commit 0bf0a09

Browse files
committed
Initial commit
0 parents  commit 0bf0a09

File tree

10 files changed

+236
-0
lines changed

10 files changed

+236
-0
lines changed

.clang-format

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
---
2+
Language: Cpp
3+
AccessModifierOffset: 0
4+
AlignAfterOpenBracket: Align
5+
AlignArrayOfStructures: None
6+
AlignConsecutiveAssignments: None
7+
AlignConsecutiveBitFields: None
8+
AlignConsecutiveDeclarations: None
9+
AlignConsecutiveMacros: None
10+
AlignEscapedNewlines: Right
11+
AlignOperands: Align
12+
AlignTrailingComments: false
13+
AllowAllArgumentsOnNextLine: false
14+
AllowAllParametersOfDeclarationOnNextLine: false
15+
AllowShortBlocksOnASingleLine: Always
16+
AllowShortCaseLabelsOnASingleLine: true
17+
AllowShortEnumsOnASingleLine: true
18+
AllowShortFunctionsOnASingleLine: All
19+
AllowShortIfStatementsOnASingleLine: AllIfsAndElse
20+
AllowShortLambdasOnASingleLine: All
21+
AllowShortLoopsOnASingleLine: true
22+
AlwaysBreakAfterReturnType: None
23+
AlwaysBreakBeforeMultilineStrings: false
24+
AlwaysBreakTemplateDeclarations: No
25+
BinPackArguments: true
26+
BinPackParameters: true
27+
BitFieldColonSpacing: Both
28+
BreakBeforeBraces: Custom
29+
BraceWrapping:
30+
AfterCaseLabel: false
31+
AfterClass: false
32+
AfterControlStatement: Never
33+
AfterEnum: false
34+
AfterFunction: false
35+
AfterNamespace: false
36+
AfterObjCDeclaration: false
37+
AfterStruct: false
38+
AfterUnion: false
39+
AfterExternBlock: false
40+
BeforeCatch: false
41+
BeforeElse: false
42+
BeforeLambdaBody: false
43+
BeforeWhile: false
44+
IndentBraces: false
45+
SplitEmptyFunction: true
46+
SplitEmptyRecord: true
47+
SplitEmptyNamespace: true
48+
BreakAfterJavaFieldAnnotations: false
49+
BreakBeforeBinaryOperators: None
50+
BreakConstructorInitializers: BeforeColon
51+
BreakInheritanceList: BeforeColon
52+
BreakStringLiterals: true
53+
ColumnLimit: 120
54+
CompactNamespaces: false
55+
ConstructorInitializerIndentWidth: 2
56+
Cpp11BracedListStyle: true
57+
EmptyLineAfterAccessModifier: Never
58+
EmptyLineBeforeAccessModifier: Never
59+
IndentAccessModifiers: true
60+
IndentCaseLabels: true
61+
IndentExternBlock: AfterExternBlock
62+
IndentGotoLabels: true
63+
IndentWidth: 2
64+
IndentWrappedFunctionNames: false
65+
KeepEmptyLinesAtTheStartOfBlocks: false
66+
PackConstructorInitializers: Never
67+
PointerAlignment: Left
68+
ReferenceAlignment: Left
69+
ReflowComments: true
70+
SeparateDefinitionBlocks: Always
71+
SortIncludes: false
72+
SpaceBeforeAssignmentOperators: true
73+
SpaceBeforeCaseColon: false
74+
SpaceBeforeCpp11BracedList: true
75+
SpaceBeforeCtorInitializerColon: true
76+
SpaceBeforeInheritanceColon: true
77+
SpaceBeforeParens: ControlStatements
78+
SpaceBeforeRangeBasedForLoopColon: true
79+
SpaceBeforeSquareBrackets: false
80+
SpaceInEmptyBlock: false
81+
SpaceInEmptyParentheses: false
82+
SpacesInCStyleCastParentheses: false
83+
SpacesInConditionalStatement: false
84+
TabWidth: 2
85+
UseTab: Never

.editorconfig

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# EditorConfig is awesome: https://EditorConfig.org
2+
3+
# https://github.com/jokeyrhyme/standard-editorconfig
4+
5+
# top-most EditorConfig file
6+
root = true
7+
8+
[*]
9+
indent_style = space
10+
indent_size = 2
11+
end_of_line = lf
12+
charset = utf-8
13+
trim_trailing_whitespace = true
14+
insert_final_newline = true
15+
16+
[*.md]
17+
indent_style = space
18+
indent_size = 3
19+
20+
[Makefile]
21+
indent_style = tab
22+
23+
[*.py]
24+
indent_style = space
25+
indent_size = 4

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto eol=lf

.github/workflows/format.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
name: C Quality Check and Formatting
3+
# Controls when the workflow will run
4+
on:
5+
push:
6+
branches:
7+
- master
8+
- main
9+
pull_request:
10+
# The sequence of runs in this workflow:
11+
jobs:
12+
lint:
13+
runs-on: ubuntu-latest
14+
timeout-minutes: 10
15+
steps:
16+
- run: lsb_release -a
17+
- run: uname -a
18+
- name: Check out Repository Code
19+
uses: actions/checkout@v3
20+
with:
21+
submodules: true # Fetch submodules
22+
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
23+
- name: Make sure script/format.sh is executable
24+
run: |
25+
chmod +x script/format.sh
26+
- name: Run clang-format
27+
run: |
28+
./script/format.sh format
29+
- name: Install clang-format
30+
run: sudo apt install clang-format
31+
- name: Commit changes
32+
uses: EndBug/add-and-commit@v9
33+
with:
34+
author_name: ${{ github.actor }}
35+
author_email: ${{ github.actor }}@users.noreply.github.com
36+
message: "Code formatting and linting"
37+
add: "." # Add all files

.gitignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Compiled Object files
2+
*.o
3+
*.obj
4+
5+
# Executables
6+
*.bin
7+
*.elf
8+
9+
# PROS
10+
bin/
11+
.vscode/
12+
.DS_Store
13+
.cache/
14+
compile_commands.json
15+
temp.log
16+
temp.errors
17+
*.ini
18+
.d/

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Cal Poly VEX U Gearslingers
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# 2025-2026
2+
Gear Slingers robot code for Push Back (2024-2025 Season)

include/.gitkeep

Whitespace-only changes.

script/format.sh

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/bin/bash
2+
3+
# Format script called by the CI
4+
# Usage:
5+
# format.sh format
6+
7+
#
8+
# Private Impl
9+
#
10+
11+
format() {
12+
# Find all C/C++ files
13+
files=$(find . -name "*.c" -o -name "*.h" -o -name "*.cpp" -o -name "*.hpp" -o -name "*.cc" -o -name "*.cxx" -o -name "*.cu")
14+
15+
if [ -z "$files" ]; then
16+
echo "No C/C++ files found"
17+
return 0
18+
fi
19+
20+
# Format each file and capture any errors
21+
error=0
22+
for file in $files; do
23+
if ! clang-format -style=file -i "$file"; then
24+
echo "Error formatting $file"
25+
error=1
26+
fi
27+
done
28+
29+
if [ $error -eq 0 ]; then
30+
echo "Successfully formatted all files"
31+
return 0
32+
else
33+
echo "Errors occurred during formatting"
34+
return 1
35+
fi
36+
}
37+
# Main script logic
38+
case "$1" in
39+
format)
40+
format
41+
;;
42+
*)
43+
echo "Usage: $0 {format}"
44+
exit 1
45+
;;
46+
esac

src/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)