-
Notifications
You must be signed in to change notification settings - Fork 9
.clang-format and .pre-commit #261
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
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
ff8769a
.clang-format and .pre-commit to be on par with GridKit.
nkoukpaizan 3bbab2c
Apply clang-format
pelesh 1a55c23
Try to fix format upon clang-format failure.
pelesh ebe67c1
Apply pre-commmit fixes
pelesh 8fc68a7
Minor manual style corrections
pelesh 5a98ede
Apply pre-commmit fixes
pelesh 78f5d49
Restart pre-commit
pelesh 68064d9
Fix includes
pelesh 6c6d41e
Apply clang-format to C++ code only
pelesh 3ff7b90
Apply pre-commmit fixes
pelesh bf85654
Restart pre-commit
pelesh 4161448
Fix more headers.
pelesh 52d096b
Apply pre-commmit fixes
pelesh 32d48ba
Restart pre-commit.
pelesh 8bc76ae
Fix CPU-only failure.
pelesh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| --- | ||
| Language: Cpp | ||
| BasedOnStyle: Microsoft | ||
|
|
||
| # Indentation | ||
| IndentWidth: 2 # 2 spaces per indent | ||
| AccessModifierOffset: -2 | ||
| IndentAccessModifiers: false # Align access modifiers to braces | ||
| NamespaceIndentation: All # Indent namspace contents | ||
| ConstructorInitializerIndentWidth: 2 | ||
|
|
||
| # Comments which match this regex will be unformatted (and therefore can be longer or have more whitespace than other comments) | ||
| CommentPragmas: '^\*\*' | ||
|
|
||
|
|
||
| # Alignment | ||
| AlignConsecutiveAssignments: | ||
| Enabled: true | ||
| AcrossEmptyLines: false | ||
| AcrossComments: true | ||
| AlignCompound: true | ||
| PadOperators: true | ||
| AlignConsecutiveBitFields: | ||
| Enabled: true | ||
| AcrossEmptyLines: false | ||
| AcrossComments: true | ||
| AlignConsecutiveDeclarations: | ||
| Enabled: true | ||
| AcrossEmptyLines: false | ||
| AcrossComments: true | ||
| # For future versions of clang-format | ||
| # AlignFunctionDeclarations: false | ||
| # AlignFunctionPointers: false | ||
| AlignConsecutiveMacros: | ||
| Enabled: true | ||
| AcrossEmptyLines: false | ||
| AcrossComments: true | ||
|
|
||
| # Newlines | ||
| ColumnLimit: 0 | ||
| BreakBeforeBraces: Allman # Braces on their own lines | ||
| SeparateDefinitionBlocks: Always # Separate definitions (functions etc.) with an empty line | ||
| AlwaysBreakTemplateDeclarations: true # Put template on their own lines | ||
| AllowShortBlocksOnASingleLine: Never | ||
| # On a newer version of clang-format, replace with BinPackArguments: OnePerLine | ||
| BinPackArguments: false # Don't allow multiple function arguments on the same line unless they all fit | ||
| BinPackParameters: false # Same but for parameters | ||
| PackConstructorInitializers: NextLine | ||
| AllowShortFunctionsOnASingleLine: None | ||
| BreakBeforeBinaryOperators: NonAssignment # Put binary operators after a line break, rather than before | ||
| AllowShortIfStatementsOnASingleLine: Never | ||
|
|
||
| # Spaces | ||
| SpaceBeforeParens: ControlStatementsExceptControlMacros | ||
| SpaceAfterCStyleCast: true | ||
| PointerAlignment: Left | ||
|
|
||
| # Includes | ||
| IncludeBlocks: Regroup # Regroup includes based on config | ||
| IncludeCategories: | ||
| - Regex: '(^"|\.hpp)' # 'local' includes | ||
| Priority: 3 | ||
| SortPriority: 0 | ||
| CaseSensitive: false | ||
| - Regex: '\/' # Library includes | ||
| Priority: 2 | ||
| SortPriority: 0 | ||
| CaseSensitive: false | ||
| - Regex: '.*' # Everything else | ||
| Priority: 1 | ||
| SortPriority: 0 | ||
| CaseSensitive: false | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| blank_issues_enabled: true | ||
| blank_issues_enabled: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| name: resolve-bot pre-commit | ||
|
|
||
| # Won't run on develop/main directly | ||
| on: [pull_request] | ||
|
|
||
| jobs: | ||
| pre-commit: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| with: | ||
| ref: ${{ github.event.pull_request.head.ref }} | ||
| - uses: actions/setup-python@v5.4.0 | ||
| - uses: pre-commit/action@v3.0.1 | ||
| - uses: EndBug/add-and-commit@v9.1.4 | ||
| # Only need to try and commit if the action failed | ||
| if: failure() | ||
| with: | ||
| fetch: false | ||
| committer_name: GitHub Actions | ||
| committer_email: actions@github.com | ||
| message: Apply pre-commmit fixes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -45,4 +45,4 @@ failure: | |
| - .report-status | ||
| rules: | ||
| - when: on_failure | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| repos: | ||
| - repo: https://github.com/pre-commit/mirrors-clang-format | ||
| rev: v19.1.7 | ||
| hooks: | ||
| - id: clang-format | ||
| types_or: [c++, c, cuda] | ||
| - repo: https://github.com/pre-commit/pre-commit-hooks | ||
| rev: v5.0.0 | ||
| hooks: | ||
| - id: check-toml | ||
| - id: forbid-new-submodules | ||
| - id: end-of-file-fixer | ||
| - id: check-yaml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| #[[ | ||
|
|
||
| @brief ReSolve library root | ||
| @brief Re::Solve library root | ||
|
|
||
| @author Slaven Peles <peless@ornl.gov> | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -185,5 +185,3 @@ class Matrix // No, class is outside ReSolve namespace | |
| { | ||
| // matrix code | ||
| }; | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,4 +2,3 @@ | |
| module load gcc/10.2 | ||
| # Load spack deps | ||
| source ./buildsystem/spack/ascent/modules/dependencies.sh | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,4 +15,3 @@ res=$? | |
| chmod -R ugo+wrx $SPACK_MIRROR & | ||
|
|
||
| exit $res | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -65,4 +65,3 @@ spack: | |
| modules: [gcc/10.2] | ||
| operating_system: rhel8 | ||
| target: ppc64le | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -67,4 +67,4 @@ class DoxygenAwesomeTabs { | |
| }) | ||
| }) | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,4 +4,3 @@ API Documentation | |
|
|
||
|
|
||
| Doxygen generated API documentation can be found here: `Doxygen Docs <html/index.html>`_ | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,4 +2,4 @@ docutils | |
| sphinx==6.2.1 | ||
| sphinx-rtd-theme==1.2.2 | ||
| breathe | ||
| m2r2 | ||
| m2r2 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,4 +2,4 @@ | |
| License | ||
| ******* | ||
|
|
||
| .. include:: ../../LICENSE | ||
| .. include:: ../../LICENSE | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,4 +19,4 @@ | |
| /* Sidebar header (and topbar for mobile) */ | ||
| .wy-side-nav-search, .wy-nav-top { | ||
| background: #343131; | ||
| } | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.