Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format modified files in ESP #240

Draft
wants to merge 54 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
bcc2f3a
:sparkles: Scripts and config files
marianabuhazi Mar 5, 2024
659b5ca
format_modified
marianabuhazi Sep 20, 2024
8bbb205
Refactoring code for simpler mocking/testing.
marianabuhazi Sep 21, 2024
8d0f15f
More refactoring before testing.
marianabuhazi Sep 21, 2024
960f99b
assign_flags function tests
marianabuhazi Sep 21, 2024
fff6be6
More changes to format_modified.sh
marianabuhazi Sep 21, 2024
7233009
Unit tests (temp)
marianabuhazi Sep 21, 2024
8eb715f
Checking formatters installation and updating header.
marianabuhazi Sep 22, 2024
f280f27
Tests for input arguments.
marianabuhazi Sep 22, 2024
f520eaa
Changes for formatting tests.
marianabuhazi Sep 22, 2024
a2365d4
Formatting file (-f) tests.
marianabuhazi Sep 22, 2024
de9d48a
Format all tests (-fa/-ca)
marianabuhazi Sep 22, 2024
b42bca8
Install tools script.
marianabuhazi Sep 23, 2024
13d0616
Renaming script, updating header.
marianabuhazi Sep 23, 2024
e62e5f8
Deleting/renaming
marianabuhazi Sep 23, 2024
34358e1
Install tools script
marianabuhazi Sep 23, 2024
a9bce01
Tests for format.sh
marianabuhazi Sep 23, 2024
cfe08c5
Updated testing.
marianabuhazi Sep 23, 2024
bfbce1f
Comments for install script.
marianabuhazi Sep 23, 2024
b76f464
Adding bats to installation script.
marianabuhazi Sep 23, 2024
9000e98
Minor change to tests.
marianabuhazi Sep 23, 2024
a85dea4
Minor change to format script.
marianabuhazi Sep 23, 2024
8fc5905
Minor changes to format.sh
marianabuhazi Sep 23, 2024
53aff25
Delete utils/scripts/format_repo.sh
marianabuhazi Sep 25, 2024
663390e
Update format.sh styling
marianabuhazi Sep 25, 2024
5beb648
Delete .github/ISSUE_TEMPLATE/workflows directory
marianabuhazi Sep 25, 2024
192d2f6
Adding pre-push hook
marianabuhazi Sep 29, 2024
bd1c2eb
Setup script for pre-push hook.
marianabuhazi Sep 29, 2024
0aa1df0
updating setup permission
marianabuhazi Sep 29, 2024
5fbd518
Setup script paths
marianabuhazi Sep 29, 2024
8d22e8b
Setup script paths
marianabuhazi Sep 29, 2024
4afed09
attempting pushing without styling.
marianabuhazi Sep 29, 2024
a073fd4
Trying to push unmodified
marianabuhazi Sep 29, 2024
dce5aea
Merge branch 'scripts' of github.com:marianabuhazi/esp into scripts
marianabuhazi Sep 29, 2024
71e4118
Adding more informative formatting
marianabuhazi Sep 29, 2024
70b660c
Undoing adder.c changes
marianabuhazi Sep 30, 2024
73493e2
Fixing header and usage once more. This looks nice!!!
marianabuhazi Sep 30, 2024
0b2006a
Adding better print statements and debugging.
marianabuhazi Sep 30, 2024
48d3b4b
Fixing indents.
marianabuhazi Sep 30, 2024
694b2e2
Updating unit tests with new prints.
marianabuhazi Sep 30, 2024
04ae911
Adding error catching for setup
marianabuhazi Sep 30, 2024
abf8cb0
Minor change prepush
marianabuhazi Sep 30, 2024
c634004
no modified files should not prevent from pushing
marianabuhazi Sep 30, 2024
6401812
More info message
marianabuhazi Sep 30, 2024
a224349
Removing unused colors.
marianabuhazi Sep 30, 2024
57b0d1c
Re-starting some re-factoring on format_repo.sh
marianabuhazi Sep 30, 2024
640f2ab
Progress on the refactoring of this code
marianabuhazi Oct 1, 2024
6a98cda
Progress on format_repo refactor, not functional yet.
marianabuhazi Oct 1, 2024
b617ce7
is module
marianabuhazi Oct 1, 2024
9422196
More changes to re-implement repo formatter.
marianabuhazi Oct 1, 2024
a4ad65d
Skip all git modules!
marianabuhazi Oct 1, 2024
46442db
Functional format repo scirpt (yay :tada:)
marianabuhazi Oct 2, 2024
52ec103
enabling formatter.
marianabuhazi Oct 2, 2024
b43d206
Final repo formatter! Handles symbolic link
marianabuhazi Oct 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
136 changes: 136 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
---
Language: Cpp
# BasedOnStyle: LLVM
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveMacros: true
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Left
AlignOperands: false
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: true
AllowAllConstructorInitializersOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: Always
AllowShortCaseLabelsOnASingleLine: true
AllowShortFunctionsOnASingleLine: All
AllowShortLambdasOnASingleLine: All
AllowShortIfStatementsOnASingleLine: Always
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: MultiLine
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: true
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: true
BeforeElse: true
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Stroustrup
BreakBeforeInheritanceComma: false
BreakInheritanceList: AfterColon
BreakBeforeTernaryOperators: false
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: AfterColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 100
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DeriveLineEnding: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeBlocks: Preserve
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
SortPriority: 0
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 3
SortPriority: 0
- Regex: '.*'
Priority: 1
SortPriority: 0
IncludeIsMainRegex: '(Test)?$'
IncludeIsMainSourceRegex: ''
IndentCaseLabels: true
IndentGotoLabels: false
IndentPPDirectives: BeforeHash
IndentWidth: 4
IndentWrappedFunctionNames: true
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Right
ReflowComments: true
SortIncludes: true
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInConditionalStatement: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpaceBeforeSquareBrackets: false
Standard: Latest
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
TabWidth: 4
UseCRLF: false
UseTab: Never
...
13 changes: 13 additions & 0 deletions .githooks/pre-push.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

FORMAT_SCRIPT="$HOME/esp/utils/scripts/format/format.sh"

if [ ! -f "$FORMAT_SCRIPT" ]; then
echo "Error: Formatting script not found."
exit 1
fi

cd "$(dirname "$FORMAT_SCRIPT")" || exit

echo "Running code format check with pre-push hook..."
./$(basename "$FORMAT_SCRIPT") -g -ca
15 changes: 15 additions & 0 deletions .githooks/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

cp "$HOME/esp/.githooks/pre-push.sh" "$HOME/esp/.git/hooks/pre-push"
if [ $? -ne 0 ]; then
echo "Error: Failed to copy pre-push hook."
exit 1
fi

chmod +x "$HOME/esp/.git/hooks/pre-push"
if [ $? -ne 0 ]; then
echo "Error: Failed to make pre-push hook executable."
exit 1
fi

echo "Pre-push hook activated successfully."
Loading