Skip to content

Commit

Permalink
Check for trailing whitespace on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
sol committed Oct 3, 2022
1 parent 0304940 commit 9ad231b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 0 additions & 2 deletions .github/pull_request_template.md

This file was deleted.

6 changes: 5 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- os: windows-latest
ghc: system
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: hspec/setup-haskell@v1
with:
ghc-version: ${{ matrix.ghc }}
Expand All @@ -63,3 +63,7 @@ jobs:
steps:
- run: false
if: needs.build.result != 'success'

- uses: actions/checkout@v3
- name: Check for trailing whitespace
run: '! git grep -I "\s\+$"'
6 changes: 3 additions & 3 deletions util/gh-md-toc
Original file line number Diff line number Diff line change
Expand Up @@ -243,16 +243,16 @@ gh_toc_grab() {
# </h1>
# became: The command <code>foo1</code></h1>
sed -e ':a' -e 'N' -e '$!ba' -e 's/\n<\/h/<\/h/g' |

# find strings that corresponds to template
$grepcmd '<a.*id="user-content-[^"]*".*</h[1-6]' |

# remove code tags
sed 's/<code>//g' | sed 's/<\/code>//g' |

# remove g-emoji
sed 's/<g-emoji[^>]*[^<]*<\/g-emoji> //g' |

# now all rows are like:
# <a id="user-content-..." href="..."><span ...></span></a> ... </h1
# format result line
Expand Down

0 comments on commit 9ad231b

Please sign in to comment.