-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upstream fixes and tools from Chemfc (#376)
- Loading branch information
1 parent
1573fdc
commit e521a8a
Showing
24 changed files
with
115 additions
and
129 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,3 +53,9 @@ examples/*/viz/ | |
examples/*.jpg | ||
examples/*.png | ||
*.mod | ||
|
||
# Video Files | ||
*.mp4 | ||
*.mov | ||
*.mkv | ||
*.avi |
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
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
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
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
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
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,33 @@ | ||
#!/bin/bash | ||
|
||
log "Formatting MFC:" | ||
|
||
fortran_files=$(find ${@:-src} -type f | grep -Ev 'src/.+/autogen/') | ||
|
||
longest=0 | ||
for filepath in $fortran_files; do | ||
if [ "${#filepath}" -gt "$longest" ]; then | ||
longest="${#filepath}" | ||
fi | ||
while [[ $# -gt 0 ]]; do | ||
case "$1" in | ||
-j|--jobs) | ||
JOBS="$2" | ||
shift | ||
;; | ||
*) | ||
echo "Format, unknown argument: $1." | ||
exit 1 | ||
;; | ||
esac | ||
|
||
shift | ||
done | ||
|
||
for filepath in $fortran_files; do | ||
echo -n " > $filepath $(printf '%*s' "$((longest - ${#filepath}))" '')" | ||
|
||
before=$(sha256sum "$filepath" | cut -d' ' -f1) | ||
|
||
python3 toolchain/indenter.py "$filepath" | ||
|
||
if ! fprettify "$filepath" \ | ||
--silent --indent 4 --c-relations --enable-replacements --enable-decl \ | ||
--whitespace-comma 1 --whitespace-multdiv 0 --whitespace-plusminus 1 \ | ||
--case 1 1 1 1 --strict-indent --line-length 1000; then | ||
error "failed to execute fprettify." | ||
error "MFC has not been fprettify'ied." | ||
exit 1 | ||
fi | ||
log "Formatting MFC:" | ||
|
||
after=$(sha256sum "$filepath" | cut -d' ' -f1) | ||
|
||
if [ "$before" != "$after" ]; then | ||
echo -e "$YELLOW[formatted]$COLOR_RESET" | ||
else | ||
echo -e "$GREEN[unchanged]$COLOR_RESET" | ||
fi | ||
done | ||
if ! find ${@:-src} -type f | grep -Ev 'autogen' | grep -E '\.(f90|fpp)$' | \ | ||
parallel --jobs ${JOBS:-1} -- \ | ||
echo "\> {}" \&\& \ | ||
python3 toolchain/indenter.py "{}" \&\& \ | ||
fprettify "{}" --silent --indent 4 --c-relations --enable-replacements \ | ||
--enable-decl --whitespace-comma 1 --whitespace-multdiv 0 \ | ||
--whitespace-plusminus 1 --case 1 1 1 1 --strict-indent \ | ||
--line-length 1000\;; then | ||
error "Formatting MFC failed." | ||
exit 1 | ||
fi | ||
|
||
ok "Done. MFC has been formatted." | ||
|
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
Oops, something went wrong.