Update blank.yml #5
This file contains 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
name: Code Style | |
on: [push, pull_request] | |
permissions: | |
contents: read | |
jobs: | |
fpm: | |
name: Fortran Code Formatting | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install fprettify | |
run: | | |
sudo apt-get install -y python3-pip | |
pip3 install fprettify | |
- name: Format Fortran files | |
run: | | |
fprettify -i 4 -d --recursive . | |
git add . | |
- name: Fail if needs reformatting | |
run: | | |
if [[ $(git status --porcelain) ]]; then | |
echo "please reformat/fprettify these files:" | |
git status --porcelain=v1 | |
echo "exact diff:" | |
git diff | |
exit 1 | |
fi |