-
Notifications
You must be signed in to change notification settings - Fork 65
Initial configuration of Codee Fortran formatter with examples (src/*.F90)
#707
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
base: develop
Are you sure you want to change the base?
Changes from all commits
b016c99
65d5c06
43778b8
8d97117
889c77f
9e732dc
6423ab3
8fe727c
49bd409
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| # DH* 20251208 - this initial .codee-format is | ||
| # identical to the NEPTUNE version except for | ||
| # Comments: ! IndentIfAlreadyIndented # Indent | ||
| # (in NEPTUNE, we use "Indent") | ||
|
|
||
| # For a detailed description of all options, see: | ||
| # https://docs.codee.com/formatter/style-options | ||
|
|
||
| AlignAmpersandToColumnLimit: false | ||
| AlignAssignmentOperators: true | ||
| AlignUseItems: | ||
| Kind: OneItemPerLine | ||
| FirstLineFit: FitIfPossible | ||
| BreakBeforeBinaryOperators: true | ||
| Casing: | ||
| Identifiers: Lowercase # Preserve | ||
| Keywords: Lowercase | ||
| LogicalConstants: Lowercase | ||
| LogicalOperators: Lowercase | ||
| RelationalOperators: Lowercase | ||
| UserDefinedOperators: Lowercase | ||
| ColumnLimit: 120 | ||
| CommentDirectivePrefixes: [] | ||
| DisabledDirectivePrefixes: [] | ||
| IndentSize: 2 | ||
climbfuji marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| IndentExceptions: | ||
| Contains: IndentBeforeAndAfter | ||
| Comments: Indent | ||
| FixedFormLabelAlignment: Right | ||
| ContinuationIndentSize: DoubleIndentSize | ||
| DoubleColonSeparator: AddAlways | ||
| EndOfLineNormalization: Unix # Autodetect | ||
climbfuji marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| EndStatementFormat: EndStructureAndName | ||
| EndStatementSeparation: | ||
| EndAssociate: Separated | ||
| EndBlockConstruct: Separated | ||
| EndBlockData: Separated | ||
| EndCritical: Separated | ||
| EndTeam: Separated | ||
| EndDoLoop: Separated | ||
| EndEnum: Separated | ||
| EndEnumerationType: Separated | ||
| EndForall: Separated | ||
| EndFunction: Separated | ||
| EndIf: Separated | ||
| EndInterface: Separated | ||
| EndModule: Separated | ||
| EndModuleProcedure: Separated | ||
| EndProgram: Separated | ||
| EndSelect: Separated | ||
| EndSubmodule: Separated | ||
| EndSubroutine: Separated | ||
| EndType: Separated | ||
| EndWhere: Separated | ||
| EnsureNewlineAtEOF: true | ||
| ConsecutiveEmptyLines: | ||
| MaxToKeep: 1 | ||
| BetweenProcedures: 1 | ||
| RemoveAtStartOfFile: true | ||
| RemoveAtEndOfFile: true | ||
| KindKeywordPrefix: AddAlways | ||
| # DH* TODO FILL THIS LIST | ||
| MacroIdentifiers: [ | ||
| "__FILE__", | ||
| "__LINE__", | ||
| "_OPENMP", | ||
| ] | ||
| RelationalOperators: UseSymbols | ||
| # DH* Note. Filed ticket 276 with Codee to prevent | ||
| # spaces between dimensions in dimension specifications | ||
| # like 'real, dimension(:,:,:), allocatable :: x' | ||
| SpacesAroundOperators: | ||
| LeftParenthesisExpression: NoTrailing | ||
| LeftParenthesisGeneric: NoSpaces | ||
| LeftParenthesisKeyword: OnlyLeading | ||
| RightParenthesisExpression: NoLeading | ||
| RightParenthesisGeneric: NoLeading | ||
| RightParenthesisKeyword: OnlyTrailing # NoLeading | ||
climbfuji marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| Assignment: Both | ||
| Association: Both | ||
| ControlFlowAssignment: Both | ||
| KeywordAssignment: NoSpaces | ||
| ParameterAssignment: NoSpaces | ||
| BinaryArithmetic: Both | ||
| Exponentiation: NoSpaces | ||
| DefinedBinary: Both | ||
| DefinedUnary: NoTrailing | ||
| Relational: Both | ||
| RelationalLegacy: Both | ||
| LogicalBinary: Both | ||
| LogicalNot: NoTrailing | ||
| UnaryPlusMinus: NoTrailing | ||
| Comma: OnlyTrailing | ||
| Concat: Both | ||
| DoubleColon: Both | ||
| RemoveConsecutiveWhitespace: true | ||
| RemoveSemicolons: true | ||
| RemoveTrailingWhitespace: true | ||
| SeparateMultipleInlineStatements: true | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| files=( | ||
| "src/ccpp_constituent_prop_mod.F90" | ||
| "src/ccpp_hashable.F90" | ||
| "src/ccpp_hash_table.F90" | ||
| "src/ccpp_scheme_utils.F90" | ||
| "src/ccpp_types.F90" | ||
| ) | ||
|
|
||
| for entry in "${files[@]}"; do | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is overly complicated and not really needed for ccpp-framework. Just for initial testing/demonstration purposes. This file will be either before this PR is merged, or at the latest once codee is integrated in GitHub actions.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the idea that we will pass any file modified in the current PR through the formatter as part of the PR?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My suggestion is to format all existing Fortran files in the repository as part of the PR. In a next step, implement GitHub actions. In a third step, integrate with capgen and make sure that the auto-generated code also complies with the formatting rules. |
||
| file=${entry} | ||
| git checkout origin/develop -- $file | ||
| codee format --verbose --on-error force $file | ||
| echo "" | ||
| echo "-------------------------------------------------" | ||
| done | ||
Uh oh!
There was an error while loading. Please reload this page.