appium_doc_lint 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Rakefile +2 -8
- data/lib/appium_doc_lint/lint/base.rb +3 -2
- data/lib/appium_doc_lint/lint/ext_missing.rb +4 -3
- data/lib/appium_doc_lint/version.rb +1 -1
- data/release_notes.md +8 -2
- data/spec/lint_spec.rb +5 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f0e9f63601abb0da7d52d2c491653f8fdbc4b14e
|
4
|
+
data.tar.gz: 3aa7a18f06ab0b2f9329d49b06835b9587a36467
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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] + '
|
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('
|
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
|
-
|
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
|
36
|
+
FAIL = 'Relative markdown links must have an extension'
|
36
37
|
|
37
38
|
def fail
|
38
39
|
FAIL
|
data/release_notes.md
CHANGED
@@ -1,4 +1,10 @@
|
|
1
|
-
#### v0.0.
|
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)
|