diff --git a/.github/common/update_fortran_style.py b/.github/common/update_fortran_style.py index b3249203c7b..ca4bedbbb97 100644 --- a/.github/common/update_fortran_style.py +++ b/.github/common/update_fortran_style.py @@ -118,7 +118,10 @@ def cleanup_comments(path, check, diff): nspaces = len(lines[0]) - len(lines[0].lstrip()) indent = "".join(repeat(" ", nspaces)) - if not any(line): + if comment.startswith("#"): + # preprocessor directives + flines.extend(lines) + elif not any(line): if any(pattern in comment for pattern in ["!!", "!<", "!>"]): flines.extend(lines) elif "SPECIFICATIONS" in comment: