Skip to content
99 changes: 99 additions & 0 deletions .codee-format
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
IndentExceptions:
Contains: IndentBeforeAndAfter
Comments: Indent
FixedFormLabelAlignment: Right
ContinuationIndentSize: DoubleIndentSize
DoubleColonSeparator: AddAlways
EndOfLineNormalization: Unix # Autodetect
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
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
17 changes: 17 additions & 0 deletions run_codee_tmp.sh
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
Copy link
Collaborator Author

@climbfuji climbfuji Dec 8, 2025

Choose a reason for hiding this comment

The 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.

Copy link
Member

Choose a reason for hiding this comment

The 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?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The 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
Loading