appium_doc_lint 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d9a90d2baebe2ed13db1355e50c3a3917eb9a161
4
- data.tar.gz: c91fd0b231071843d57892b66b567a99f3ee9735
3
+ metadata.gz: f0e9f63601abb0da7d52d2c491653f8fdbc4b14e
4
+ data.tar.gz: 3aa7a18f06ab0b2f9329d49b06835b9587a36467
5
5
  SHA512:
6
- metadata.gz: 470605d83b8fc7aa33def2be3ca456f38ee13eae133ee0a089b775e3a4f39ddae3e03feb94a78b4bc991bce1c45bedab85a65e2af2a0990823fc7f07b9262ae0
7
- data.tar.gz: bcb2a93f069a8bf49b0db79bfb77be2d39e29f60ec7aa7b213ba5ebc14ee376ddb259e18bcc17aaf1d0fc499cba3a7c9a69b4fba9d56f43d3ba9bbb161c4ff1d
6
+ metadata.gz: ab9a10d536e7fb7d31034d141b897e51197ac622f0378587531179aa728abe18786c4239cc810af5e39ea05e19d494de64a43ef9c7b1138f737a6e0be45bb201
7
+ data.tar.gz: 0dbd40d2dec1e79c46d80db6cceefbfedf2454730810af9e0420632f656515d5a41b16af4102a0beda0086e48986fc54262792da76290f3a395b8fa93c7bcebd
data/Rakefile CHANGED
@@ -112,32 +112,26 @@ end
112
112
  desc 'Update release notes'
113
113
  task :notes do
114
114
  tag_sort = ->(tag1,tag2) do
115
- begin
116
115
  tag1_numbers = tag1.match(/\.?v(\d+\.\d+\.\d+)$/)[1].split('.').map! { |n| n.to_i }
117
116
  tag2_numbers = tag2.match(/\.?v(\d+\.\d+\.\d+)$/)[1].split('.').map! { |n| n.to_i }
118
117
  tag1_numbers <=> tag2_numbers
119
- rescue
120
- raise "Match failed on\n'#{tag1}'\n'#{tag2}'"
121
- end
122
118
  end
123
119
 
124
120
  tags = `git tag`.split "\n"
125
121
  tags.sort! &tag_sort
126
122
  pairs = []
127
- tags.each_index { |a| pairs.push tags[a] + '..' + tags[a+1] unless tags[a+1].nil? }
123
+ tags.each_index { |a| pairs.push tags[a] + '...' + tags[a+1] unless tags[a+1].nil? }
128
124
 
129
125
  notes = ''
130
126
 
131
127
  dates = `git log --tags --simplify-by-decoration --pretty="format:%d %ad" --date=short`.split "\n"
132
- # " (tag: v0.0.21) 2013-03-22"
133
- dates.reject! { |d| ! d.match /\(tag: v\d+\.\d+\.\d+\) \d+-\d+-\d+/ }
134
128
 
135
129
  pairs.sort! &tag_sort
136
130
  pairs.reverse! # pairs are in reverse order.
137
131
 
138
132
  tag_date = []
139
133
  pairs.each do |pair|
140
- tag = pair.split('..').last
134
+ tag = pair.split('...').last
141
135
  dates.each do |line|
142
136
  # regular tag, or tag on master.
143
137
  if line.include?(tag + ')') || line.include?(tag + ',')
@@ -15,8 +15,9 @@ module Appium
15
15
  #
16
16
  # @param line_number [int] line number to warn on
17
17
  # @return [warnings]
18
- def warn line_number
19
- warnings[line_number + 1] += [fail]
18
+ def warn line_number, extra=nil
19
+ message = extra ? fail + ' ' + extra : fail
20
+ warnings[line_number + 1] += [message]
20
21
  warnings
21
22
  end
22
23
 
@@ -15,16 +15,17 @@ module Appium
15
15
  # /(?<!!) -- negative look behind. excludes image links
16
16
  match_data = line.match(/(?<!!) \[ ( [^\[]* ) \] \( ( [^)\/]+ ) \)/x)
17
17
  next unless match_data # skip nil matches
18
+ full = match_data[0]
18
19
  link_text = match_data[1]
19
20
  link_target = match_data[2]
20
21
 
21
22
  if link_target && !link_target.include?('/')
22
23
  ext = File.extname link_target
23
24
  if ext.empty?
24
- warn index
25
+ warn index, full
25
26
  else
26
27
  ext, hash = ext.split '#'
27
- warn index if ext.empty?
28
+ warn index, full if ext.empty?
28
29
  end
29
30
  end
30
31
  end
@@ -32,7 +33,7 @@ module Appium
32
33
  warnings
33
34
  end
34
35
 
35
- FAIL = 'Relative markdown links must have an extension. [readme](readme.md)'
36
+ FAIL = 'Relative markdown links must have an extension'
36
37
 
37
38
  def fail
38
39
  FAIL
@@ -1,6 +1,6 @@
1
1
  module Appium
2
2
  class Lint
3
- VERSION = '0.0.4' unless defined? ::Appium::Lint::VERSION
3
+ VERSION = '0.0.5' unless defined? ::Appium::Lint::VERSION
4
4
  DATE = '2014-04-26' unless defined? ::Appium::Lint::DATE
5
5
  end
6
6
  end
data/release_notes.md CHANGED
@@ -1,4 +1,10 @@
1
- #### v0.0.2 2014-04-19
1
+ #### v0.0.4 2014-04-26
2
+
3
+ - [293f87b](https://github.com/appium/appium_doc_lint/commit/293f87b56667e1c0d81b069cc9b700be521a965a) Release 0.0.4
4
+ - [54813cf](https://github.com/appium/appium_doc_lint/commit/54813cf164f33866d7643260498d115f40411d0f) Add link check for invalid hyperlinks
5
+
6
+
7
+ #### v0.0.3 2014-04-19
2
8
 
3
9
  - [5bcd5c5](https://github.com/appium/appium_doc_lint/commit/5bcd5c58d25dace3ec356394d54f0a5d988602dd) Release 0.0.3
4
10
  - [b77dbb8](https://github.com/appium/appium_doc_lint/commit/b77dbb8c2d262cd9254a9cd2cf79227400632720) Set exit code when issues are detected
@@ -8,7 +14,7 @@
8
14
  - [3ab939a](https://github.com/appium/appium_doc_lint/commit/3ab939aea1989e823c1fd3c27d6428f539c212eb) Detect more than one h1 per doc
9
15
 
10
16
 
11
- ####
17
+ #### v0.0.2 2014-04-19
12
18
 
13
19
  - [910d158](https://github.com/appium/appium_doc_lint/commit/910d1583b5286c9c13242f97722ce50c99023944) Release 0.0.2
14
20
  - [4759871](https://github.com/appium/appium_doc_lint/commit/4759871312485a6574d468eb4baba703c44435e3) Guarantee glob order
data/spec/lint_spec.rb CHANGED
@@ -17,7 +17,7 @@ class Appium::Lint
17
17
  9 => [H1Multiple::FAIL],
18
18
  11 => [H456Invalid::FAIL],
19
19
  21 => [H1Multiple::FAIL],
20
- 23 => [ExtMissing::FAIL] } }
20
+ 23 => [ExtMissing::FAIL + ' [ok](ok#ok)'] } }
21
21
 
22
22
  # convert path/to/0.md to 0.md
23
23
  actual.keys.each do |key|
@@ -46,7 +46,7 @@ class Appium::Lint
46
46
  9: #{H1Multiple::FAIL}
47
47
  11: #{H456Invalid::FAIL}
48
48
  21: #{H1Multiple::FAIL}
49
- 23: #{ExtMissing::FAIL}
49
+ 23: #{ExtMissing::FAIL + ' [ok](ok#ok)'}
50
50
  REPORT
51
51
 
52
52
  expect(actual).to eq(expected)
@@ -293,9 +293,9 @@ markdown--
293
293
  [intro](intro#start)
294
294
  MARKDOWN
295
295
  rule = ExtMissing.new data: data
296
- expected = { 1 => [rule.fail],
297
- 2 => [rule.fail],
298
- 3 => [rule.fail] }
296
+ expected = { 1 => [rule.fail + ' [link to read](readme)'],
297
+ 2 => [rule.fail + ' [ok](ok#ok)'],
298
+ 3 => [rule.fail + ' [intro](intro#start)'] }
299
299
  actual = rule.call
300
300
 
301
301
  expect(actual).to eq(expected)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appium_doc_lint
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - code@bootstraponline.com