Skip to content
Permalink
Browse files

MNT: Lint markdown files

  • Loading branch information...
kernc committed May 2, 2019
1 parent f5b4a54 commit fbaf2bf28d8f3ace1d2cc7507ccfc528548be4d6
Showing with 18 additions and 0 deletions.
  1. +1 −0 .github/issue_template.md
  2. +16 −0 .github/lint-markdown.sh
  3. +1 −0 .travis.yml
@@ -3,6 +3,7 @@ NOTE: Only submit issues for Python package "pdoc3" on PyPI.
Python package "pdoc" lives elsewhere.
-->


### Expected Behavior


@@ -0,0 +1,16 @@
#!/bin/bash
set -eu

error () { echo "ERROR in '$file': $@" >&2; exit 1; }

for file in "$@"; do
if grep '\x0D' "$file"; then
error 'Use LF to end lines, not CRLF'
fi
if grep -Pzo '(?<![-=\n]\n\n)(?<=\n)(#+ \N*\w\N*|\N*\w\N*\n-+)\n' "$file"; then
error 'Need two blank lines before heading'
fi
if grep -Pv '^(\[[^\]]+\]: .*|\[!.*\))$' "$file" | grep -Pvn '^.{0,90}$'; then
error 'Lines too long'
fi
done
@@ -19,6 +19,7 @@ matrix:
before_script:
- pip install flake8 coverage mypy
script:
- find -name '*.md' | xargs .github/lint-markdown.sh
- flake8
- mypy pdoc
- time catchsegv coverage run setup.py test

0 comments on commit fbaf2bf

Please sign in to comment.
You can’t perform that action at this time.