Skip to content

Commit c2b99a7

Browse files
Run markdownlint tests with Bundler and Rake
1 parent 75bee20 commit c2b99a7

File tree

5 files changed

+44
-5
lines changed

5 files changed

+44
-5
lines changed

.travis.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ rvm:
66
- 2.3.0
77

88
install:
9-
- gem install mdl
9+
- bundle install
1010

1111
script:
12-
- mdl --style 'markdown.rb' README.md
13-
- mdl --style 'markdown.rb' CONTRIBUTING.md
12+
- bundle exec rake test

CONTRIBUTING.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,12 @@ formatting/markup/style rules so that the style remains consistent:
2020
alphabetical order at the end of the document, and capitalize the first word
2121
of the link label.
2222

23-
Install [Markdownlint] to check your changes, and run:
23+
Use Ruby and [Markdownlint] to check your changes:
2424

2525
```sh
26-
mdl --style 'markdown.rb' README.md
26+
gem install bundler
27+
bundle install
28+
bundle exec rake test
2729
```
2830

2931
**IMPORTANT**: By submitting a patch, you agree that your work will be

Gemfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
source "https://rubygems.org"
2+
3+
gem "mdl"
4+
gem "rake"

Gemfile.lock

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
kramdown (1.13.2)
5+
mdl (0.4.0)
6+
kramdown (~> 1.12, >= 1.12.0)
7+
mixlib-cli (~> 1.7, >= 1.7.0)
8+
mixlib-config (~> 2.2, >= 2.2.1)
9+
mixlib-cli (1.7.0)
10+
mixlib-config (2.2.4)
11+
rake (12.0.0)
12+
13+
PLATFORMS
14+
ruby
15+
16+
DEPENDENCIES
17+
mdl
18+
rake
19+
20+
BUNDLED WITH
21+
1.14.5

Rakefile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
task :test do
2+
exit_code = 0
3+
files = ["README.md", "CONTRIBUTING.md"]
4+
files.each do |file|
5+
begin
6+
sh "bundle exec mdl --style 'markdown.rb' #{file}"
7+
rescue Exception => ex
8+
exit_code = 1
9+
end
10+
end
11+
12+
exit exit_code
13+
end

0 commit comments

Comments
 (0)