Merge pull request #245 from plotly/most-tests-passing-again #511
This file contains hidden or 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: Lint | |
| on: [push, pull_request] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Use Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: '18' | |
| - name: "Lint markdown files" | |
| run: | | |
| npm install -g markdownlint-cli | |
| markdownlint '**/*.md' --ignore-path=.gitignore | |
| - name: "No trailing whitespaces at EOLs" | |
| run: | | |
| EXIT_CODE=0 | |
| git --no-pager grep --full-name -I -n -e ' $' . && EXIT_CODE=1 | |
| exit $EXIT_CODE | |
| - name: "No tab characters" | |
| run: | | |
| EXIT_CODE=0 | |
| git --no-pager grep --full-name -I -n -P '\t' . && EXIT_CODE=1 | |
| exit $EXIT_CODE | |
| - name: "Newline at EOF" | |
| run: | | |
| EXIT_CODE=0 | |
| for f in $(git --no-pager grep --full-name -I -l ''); do | |
| tail -c1 "$f" | read -r _ || echo "$f" | |
| tail -c1 "$f" | read -r _ || EXIT_CODE=1 | |
| done | |
| exit $EXIT_CODE |