Skip to content

Commit

Permalink
Issue checkstyle#8909: add markdownlint to travis ci
Browse files Browse the repository at this point in the history
  • Loading branch information
pbludov committed Oct 31, 2020
1 parent 2d71ee0 commit 3fe7f2b
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .ci/jsoref-spellchecker/whitelist.words
Original file line number Diff line number Diff line change
Expand Up @@ -816,11 +816,13 @@ mailhost
mailto
mainframemodel
marazmatic
markdownlint
Massol
mavenbadge
maxmethods
MCHECKSTYLE
mct
mdl
mega
membername
MENFORCER
Expand Down
4 changes: 4 additions & 0 deletions .ci/travis/travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,10 @@ spotbugs-and-pmd)
exit "$RESULT"
;;

markdownlint)
mdl -g . && echo "All .md files verified"
;;

*)
echo "Unexpected argument: $1"
sleep 5s
Expand Down
1 change: 1 addition & 0 deletions .mdlrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
style "#{File.dirname(__FILE__)}/config/markdownlint.rb"
8 changes: 7 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@ addons:
packages:
- xsltproc
- xmlstarlet
- ruby

branches:
only:
- master

install:
- ""
- gem install mdl

jobs:
fast_finish: true
Expand All @@ -41,6 +42,11 @@ jobs:
- CMD="./.ci/test-spelling-unknown-words.sh"
- SKIP_JOB_BY_FILES="false"

# lint for .md files
- env:
- DESC="markdown lint"
- CMD="./.ci/travis/travis.sh markdownlint"

# unit tests (openjdk8)
- jdk: openjdk8
env:
Expand Down
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Checkstyle
# ![](https://raw.githubusercontent.com/checkstyle/resources/master/img/checkstyle-logos/checkstyle-logo-260x99.png)

Checkstyle is a tool for checking Java source code for adherence to a Code Standard
or set of validation rules (best practices).

[![][travis img]][travis]
[![][appveyor img]][appveyor]
Expand All @@ -21,11 +24,6 @@
Members chat: [![][gitter_mem img]][gitter_mem]
Contributors chat: [![][gitter_con img]][gitter_con]

![](https://raw.githubusercontent.com/checkstyle/resources/master/img/checkstyle-logos/checkstyle-logo-260x99.png)

Checkstyle is a tool for checking Java source code for adherence to a Code Standard
or set of validation rules (best practices).

The latest release version can be found at
[GitHub releases](https://github.com/checkstyle/checkstyle/releases/)
or at [Maven repo](https://repo1.maven.org/maven2/com/puppycrawl/tools/checkstyle/).
Expand Down
8 changes: 8 additions & 0 deletions config/markdownlint.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Enable all rules
all

# The maximum allowed line length is 100
rule 'MD013', :line_length => 100

# We do not use some parsers, our md files are for Github mostly, and it works fine with bare URLs
exclude_rule 'MD034'
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1504,6 +1504,7 @@
<exclude>java_regexp.header</exclude>
<exclude>org.eclipse.jdt.core.prefs</exclude>
<exclude>intellij-idea-inspections.properties</exclude>
<exclude>markdownlint.rb</exclude>
</excludes>
</validationSet>
<validationSet>
Expand Down

0 comments on commit 3fe7f2b

Please sign in to comment.