inch 0.6.3 → 0.6.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/inch/language/ruby/provider/yard/object/base.rb +1 -1
- data/lib/inch/language/ruby/provider/yard/object/method_object.rb +1 -1
- data/lib/inch/language/ruby/provider/yard/object/method_parameter_object.rb +9 -4
- data/lib/inch/version.rb +1 -1
- data/test/fixtures/ruby/simple/lib/foo.rb +6 -0
- data/test/unit/language/ruby/code_object/method_object_test.rb +6 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 97a2e0db4145398867af07819d6657c6473c7cf2
|
4
|
+
data.tar.gz: 288d4945533cde5327a6479d0c4225d8cdff562b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0958cf52771d502deeaa704a0c976dc8f3adb758f114fec1a9cb5bd08be81d1a5ced6c7a42f5ce609003d727a79acda12e879fe798cf3cbab97956dab33e7cca
|
7
|
+
data.tar.gz: aa5badaa8ea8c48db207dfe9830a42c59086471f9bd314478753de0c54659eba7b485fd7a1358a8af4a187e51b13826629d30834e0779e5fd39ad2bacedeb24f
|
data/CHANGELOG.md
CHANGED
@@ -21,7 +21,8 @@ module Inch
|
|
21
21
|
@in_signature = in_signature
|
22
22
|
end
|
23
23
|
|
24
|
-
|
24
|
+
IGNORE_NAME = "_"
|
25
|
+
BAD_NAME_EXCEPTIONS = [IGNORE_NAME, "id"]
|
25
26
|
BAD_NAME_THRESHOLD = 3
|
26
27
|
|
27
28
|
# @return [Boolean] +true+ if the name of the parameter is
|
@@ -38,13 +39,13 @@ module Inch
|
|
38
39
|
|
39
40
|
# @return [Boolean] +true+ if an additional description given?
|
40
41
|
def described?
|
41
|
-
described_by_tag? || described_by_docstring?
|
42
|
+
described_by_tag? || described_by_docstring? || ignore?
|
42
43
|
end
|
43
44
|
|
44
45
|
# @return [Boolean] +true+ if the parameter is mentioned in the
|
45
46
|
# docs
|
46
47
|
def mentioned?
|
47
|
-
!!@tag || mentioned_by_docstring?
|
48
|
+
!!@tag || mentioned_by_docstring? || ignore?
|
48
49
|
end
|
49
50
|
|
50
51
|
# @return [Boolean] +true+ if the parameter is a splat argument
|
@@ -54,7 +55,7 @@ module Inch
|
|
54
55
|
|
55
56
|
# @return [Boolean] +true+ if the type of the parameter is defined
|
56
57
|
def typed?
|
57
|
-
@tag && @tag.types && !@tag.types.empty?
|
58
|
+
(@tag && @tag.types && !@tag.types.empty?) || ignore?
|
58
59
|
end
|
59
60
|
|
60
61
|
# @return [Boolean] +true+ if the parameter is mentioned in the
|
@@ -78,6 +79,10 @@ module Inch
|
|
78
79
|
end
|
79
80
|
end
|
80
81
|
|
82
|
+
def ignore?
|
83
|
+
name == IGNORE_NAME
|
84
|
+
end
|
85
|
+
|
81
86
|
def mentioned_by_docstring?
|
82
87
|
if @method.docstring.mentions_parameter?(name)
|
83
88
|
true
|
data/lib/inch/version.rb
CHANGED
@@ -13,6 +13,12 @@ module Foo
|
|
13
13
|
def method_with_missing_param_doc(param1, param2, param3)
|
14
14
|
end
|
15
15
|
|
16
|
+
# Provides an example of a missing described parameter.
|
17
|
+
#
|
18
|
+
# @return [void]
|
19
|
+
def method_with_missing_ignore_param_doc(_)
|
20
|
+
end
|
21
|
+
|
16
22
|
# Provides an example of a wrongly described parameter.
|
17
23
|
#
|
18
24
|
# @param param1 [String]
|
@@ -20,6 +20,12 @@ describe ::Inch::Language::Ruby::CodeObject::MethodObject do
|
|
20
20
|
refute m.undocumented?
|
21
21
|
end
|
22
22
|
|
23
|
+
it 'does not complain about _ parameter' do
|
24
|
+
m = @objects.find('Foo::Bar#method_with_missing_ignore_param_doc')
|
25
|
+
assert_equal 100, m.score
|
26
|
+
refute m.undocumented?
|
27
|
+
end
|
28
|
+
|
23
29
|
it 'should not count a call to `raise`' do
|
24
30
|
m = @objects.find('InchTest#raising_method')
|
25
31
|
assert_equal 0, m.score
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- René Föhring
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-06
|
11
|
+
date: 2015-08-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|