Skip to content

Commit

Permalink
add check to keep an empty line above vim modeline in waivers
Browse files Browse the repository at this point in the history
Signed-off-by: Jiri Jaburek <[email protected]>
  • Loading branch information
comps committed May 3, 2024
1 parent b41931e commit dabb457
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/sanity.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,19 @@ jobs:
print(str(e))
sys.exit(1)
EOF
- name: Check VIm modeline empty line
run: |
function err { echo -e "error: $1" >&2; exit 1; }
for file in conf/waivers/*; do
[[ -f "$file" ]] || err "$file not found"
out=$(grep -B1 '^# vim' "$file") || err "vim modeline not found in $file"
out=$(head -n1 <<<"$out")
if [[ $out ]]; then
msg="line above vim modeline in $file not empty: $out"
msg+="\nPlease keep one empty line above the vim modeline."
err "$msg"
fi
done
flake8:
runs-on: ubuntu-latest
steps:
Expand Down

0 comments on commit dabb457

Please sign in to comment.