Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
62 changes: 62 additions & 0 deletions .github/workflows/fortran-formatting.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Codee format Fortran

on:
pull_request:

env:
CODEE_VERSION: 2025.4.5

permissions:
contents: write
pull-requests: write

jobs:
format:
name: Check and fix Fortran formatting
runs-on: ubuntu-22.04

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.head_ref }}

- name: Get modified Fortran files
#id: modified-files
run: |
MODIFIED_FILES=$(git diff --name-only --diff-filter=d origin/${{ github.base_ref }}...HEAD -- '*.f90' '*.F90' '*.f' '*.F')
echo "MODIFIED_FILES=$MODIFIED_FILES" >> $GITHUB_ENV

- name: Install Codee
if: env.MODIFIED_FILES != ''
run: |
echo "Installing Codee ${CODEE_VERSION} ..."
wget https://codee.com/release/codee-${CODEE_VERSION}-linux-x86_64.tar.gz
tar -xf codee-${CODEE_VERSION}-linux-x86_64.tar.gz

- name: Run `codee format` on modified files
if: env.MODIFIED_FILES != ''
run: |
export PATH="${PWD}/codee-${CODEE_VERSION}-linux-x86_64/bin:${PATH}"
codee format --accept-eula --verbose $MODIFIED_FILES

# - name: Run `codee format` on modified files
# if: env.MODIFIED_FILES != ''
# run: |
# export PATH="${PWD}/codee-${CODEE_VERSION}-linux-x86_64/bin:${PATH}"
# git codee-format --diff ${{ github.base_ref }} HEAD
# git diff

# - name: Commit changes
# if: env.MODIFIED_FILES != ''
# run: |
# if ! git diff --quiet; then
# # Push with the github-actions user. More information at:
# # https://github.com/actions/checkout?tab=readme-ov-file#push-a-commit-using-the-built-in-token
# git commit -c user.name="github-actions[bot]" -c user.email="41898282+github-actions[bot]@users.noreply.github.com" -am "Apply codee format formatting fixes"
# git push --set-upstream origin ${{ github.head_ref }}
# else
# echo "No changes detected."
# exit 0
# fi
2 changes: 2 additions & 0 deletions src/ccpp_hash_table.F90
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
!!XXgoldyXX: To do, statistics output
module ccpp_hash_table

! Modify this file ...

use ccpp_hashable, only: ccpp_hashable_t

implicit none
Expand Down
Loading