rubocop-publicdoc2 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/rubocop/cop/style/public_method_documentation.rb +5 -0
- data/lib/rubocop/publicdoc2/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 834d819dc85bf442a24ad2b911701413dd126f7fec7e9fcc44345ae68ec254a1
|
4
|
+
data.tar.gz: 3d79c19d27543a51871337737d238f71cf9c59baa1e57d2689192f468b81bddd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb764c614208969c5772685631e569f5b4195a471c08026949e2c10979ac6aaf4a8cf23d66479658d35a9929164d15af966301a9c823db0746f02cd5acbec286
|
7
|
+
data.tar.gz: 374e7fd0a4183c6241044270909030eaf4ef280cac58cea226b71721d63af973332daed2dacc49af398fc4ad475e038cbe9e225f259973841ea0c16700147ecb
|
data/Gemfile.lock
CHANGED
@@ -39,6 +39,8 @@ module RuboCop
|
|
39
39
|
|
40
40
|
MSG_ATTRIBUTES_AND_PARAMETERS_NO_COEXIST = 'Attributes and Parameters should not exist on same method.'
|
41
41
|
MSG_DESCRIPTION_SHOULD_END_WITH_BLANK_COMMENT = 'Description should end with blank comment.'
|
42
|
+
MSG_ILLEGAL_RANGE_BODY_FORMAT = "Illegal %s format: '# * <tt>:{argument}</tt> {description}'."
|
43
|
+
MSG_ILLEGAL_RANGE_RET_BODY_FORMAT = "Illegal %s format: '# * <tt>{CLASS}</tt> {description}'."
|
42
44
|
MSG_MISSING_DOCUMENTATION = 'Missing public method documentation comment for `%s`.'
|
43
45
|
MSG_MISSING_PARAMETERS = 'Parameter is missing for `%s`.'
|
44
46
|
MSG_PARAMETERS_ARG_NAME_MISMATCH = 'Parameter name `%s` does not match argument name `%s`.'
|
@@ -46,11 +48,13 @@ module RuboCop
|
|
46
48
|
MSG_PARAMETERS_SHOULD_BE_BEFORE_RETURNS = 'Parameters should be before Returns.'
|
47
49
|
MSG_RANGE_BODY_EMPTY = '%s body is empty.'
|
48
50
|
MSG_RETURNS_SHOULD_BE_LAST = 'Returns should be last.'
|
51
|
+
MSG_UNNECESSARY_PARAMETERS = 'Unnecessary Parameter documentation for `%s`.'
|
49
52
|
|
50
53
|
# https://regex101.com/
|
51
54
|
ATTR_REGEXP = /^ *# *=== *Attributes:/.freeze
|
52
55
|
DOC_PARM_REGEXP = %r{^# \* <tt>:(\w+)</tt>}.freeze
|
53
56
|
DOC_RET_REGEXP = %r{^# \* <tt>([:\w]+)</tt>}.freeze
|
57
|
+
DOC_SUB_PARM_REGEXP = %r{^# \** <code>([.:\w ]+-*[.:\w ]+)</code>([.:\w ]*-*[.:\w ]*)}.freeze
|
54
58
|
PARMS_REGEXP = /^ *# *=== *Parameters:/.freeze
|
55
59
|
RETURNS_REGEXP = /^ *# *=== *Returns: */.freeze
|
56
60
|
|
@@ -120,6 +124,7 @@ module RuboCop
|
|
120
124
|
grd = attrs_range.missing? || parameters_range.missing?
|
121
125
|
add_offense(attrs_range.start_comment, message: MSG_ATTRIBUTES_AND_PARAMETERS_NO_COEXIST) unless grd
|
122
126
|
|
127
|
+
# copied from documentation_comment.rb
|
123
128
|
special_comm = preceding_lines.any? do |comment|
|
124
129
|
!AnnotationComment.new(comment, annotation_keywords).annotation? &&
|
125
130
|
!interpreter_directive_comment?(comment) &&
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop-publicdoc2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul Kristoff
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-08-
|
11
|
+
date: 2021-08-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|