yard-lint 0.2.1 → 1.1.0
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/CHANGELOG.md +73 -1
- data/README.md +121 -89
- data/bin/yard-lint +44 -0
- data/lib/yard/lint/config.rb +35 -3
- data/lib/yard/lint/config_generator.rb +191 -0
- data/lib/yard/lint/config_loader.rb +1 -1
- data/lib/yard/lint/result_builder.rb +10 -1
- data/lib/yard/lint/validators/base.rb +77 -12
- data/lib/yard/lint/validators/documentation/markdown_syntax/config.rb +20 -0
- data/lib/yard/lint/validators/documentation/markdown_syntax/messages_builder.rb +44 -0
- data/lib/yard/lint/validators/documentation/markdown_syntax/parser.rb +53 -0
- data/lib/yard/lint/validators/documentation/markdown_syntax/result.rb +25 -0
- data/lib/yard/lint/validators/documentation/markdown_syntax/validator.rb +38 -0
- data/lib/yard/lint/validators/documentation/markdown_syntax.rb +37 -0
- data/lib/yard/lint/validators/documentation/undocumented_boolean_methods/validator.rb +7 -6
- data/lib/yard/lint/validators/documentation/undocumented_boolean_methods.rb +26 -1
- data/lib/yard/lint/validators/documentation/undocumented_method_arguments/validator.rb +4 -5
- data/lib/yard/lint/validators/documentation/undocumented_method_arguments.rb +26 -1
- data/lib/yard/lint/validators/documentation/undocumented_objects/config.rb +2 -1
- data/lib/yard/lint/validators/documentation/undocumented_objects/parser.rb +95 -5
- data/lib/yard/lint/validators/documentation/undocumented_objects/validator.rb +15 -11
- data/lib/yard/lint/validators/documentation/undocumented_objects.rb +131 -2
- data/lib/yard/lint/validators/documentation/undocumented_options/config.rb +20 -0
- data/lib/yard/lint/validators/documentation/undocumented_options/parser.rb +53 -0
- data/lib/yard/lint/validators/documentation/undocumented_options/result.rb +29 -0
- data/lib/yard/lint/validators/documentation/undocumented_options/validator.rb +38 -0
- data/lib/yard/lint/validators/documentation/undocumented_options.rb +40 -0
- data/lib/yard/lint/validators/semantic/abstract_methods/validator.rb +4 -5
- data/lib/yard/lint/validators/semantic/abstract_methods.rb +31 -1
- data/lib/yard/lint/validators/tags/api_tags/validator.rb +4 -5
- data/lib/yard/lint/validators/tags/api_tags.rb +34 -1
- data/lib/yard/lint/validators/tags/collection_type/config.rb +22 -0
- data/lib/yard/lint/validators/tags/collection_type/messages_builder.rb +73 -0
- data/lib/yard/lint/validators/tags/collection_type/parser.rb +50 -0
- data/lib/yard/lint/validators/tags/collection_type/result.rb +25 -0
- data/lib/yard/lint/validators/tags/collection_type/validator.rb +92 -0
- data/lib/yard/lint/validators/tags/collection_type.rb +50 -0
- data/lib/yard/lint/validators/tags/example_syntax/config.rb +20 -0
- data/lib/yard/lint/validators/tags/example_syntax/messages_builder.rb +28 -0
- data/lib/yard/lint/validators/tags/example_syntax/parser.rb +79 -0
- data/lib/yard/lint/validators/tags/example_syntax/result.rb +42 -0
- data/lib/yard/lint/validators/tags/example_syntax/validator.rb +88 -0
- data/lib/yard/lint/validators/tags/example_syntax.rb +42 -0
- data/lib/yard/lint/validators/tags/invalid_types/validator.rb +8 -8
- data/lib/yard/lint/validators/tags/invalid_types.rb +25 -1
- data/lib/yard/lint/validators/tags/meaningless_tag/config.rb +22 -0
- data/lib/yard/lint/validators/tags/meaningless_tag/messages_builder.rb +28 -0
- data/lib/yard/lint/validators/tags/meaningless_tag/parser.rb +53 -0
- data/lib/yard/lint/validators/tags/meaningless_tag/result.rb +26 -0
- data/lib/yard/lint/validators/tags/meaningless_tag/validator.rb +82 -0
- data/lib/yard/lint/validators/tags/meaningless_tag.rb +43 -0
- data/lib/yard/lint/validators/tags/option_tags/validator.rb +11 -6
- data/lib/yard/lint/validators/tags/option_tags.rb +26 -1
- data/lib/yard/lint/validators/tags/order/validator.rb +4 -5
- data/lib/yard/lint/validators/tags/order.rb +25 -1
- data/lib/yard/lint/validators/tags/redundant_param_description/config.rb +33 -0
- data/lib/yard/lint/validators/tags/redundant_param_description/messages_builder.rb +61 -0
- data/lib/yard/lint/validators/tags/redundant_param_description/parser.rb +67 -0
- data/lib/yard/lint/validators/tags/redundant_param_description/result.rb +25 -0
- data/lib/yard/lint/validators/tags/redundant_param_description/validator.rb +148 -0
- data/lib/yard/lint/validators/tags/redundant_param_description.rb +168 -0
- data/lib/yard/lint/validators/tags/tag_type_position/config.rb +22 -0
- data/lib/yard/lint/validators/tags/tag_type_position/messages_builder.rb +38 -0
- data/lib/yard/lint/validators/tags/tag_type_position/parser.rb +51 -0
- data/lib/yard/lint/validators/tags/tag_type_position/result.rb +25 -0
- data/lib/yard/lint/validators/tags/tag_type_position/validator.rb +111 -0
- data/lib/yard/lint/validators/tags/tag_type_position.rb +51 -0
- data/lib/yard/lint/validators/tags/type_syntax/config.rb +21 -0
- data/lib/yard/lint/validators/tags/type_syntax/messages_builder.rb +27 -0
- data/lib/yard/lint/validators/tags/type_syntax/parser.rb +54 -0
- data/lib/yard/lint/validators/tags/type_syntax/result.rb +25 -0
- data/lib/yard/lint/validators/tags/type_syntax/validator.rb +76 -0
- data/lib/yard/lint/validators/tags/type_syntax.rb +38 -0
- data/lib/yard/lint/validators/warnings/duplicated_parameter_name/validator.rb +4 -5
- data/lib/yard/lint/validators/warnings/duplicated_parameter_name.rb +26 -1
- data/lib/yard/lint/validators/warnings/invalid_directive_format/validator.rb +4 -5
- data/lib/yard/lint/validators/warnings/invalid_directive_format.rb +26 -1
- data/lib/yard/lint/validators/warnings/invalid_tag_format/validator.rb +4 -5
- data/lib/yard/lint/validators/warnings/invalid_tag_format.rb +25 -1
- data/lib/yard/lint/validators/warnings/unknown_directive/validator.rb +4 -5
- data/lib/yard/lint/validators/warnings/unknown_directive.rb +26 -1
- data/lib/yard/lint/validators/warnings/unknown_parameter_name/parser.rb +4 -1
- data/lib/yard/lint/validators/warnings/unknown_parameter_name/validator.rb +4 -5
- data/lib/yard/lint/validators/warnings/unknown_parameter_name.rb +23 -1
- data/lib/yard/lint/validators/warnings/unknown_tag/validator.rb +4 -5
- data/lib/yard/lint/validators/warnings/unknown_tag.rb +26 -1
- data/lib/yard/lint/version.rb +1 -1
- data/lib/yard/lint.rb +1 -0
- data/misc/logo.png +0 -0
- metadata +64 -1
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Yard
|
|
4
|
+
module Lint
|
|
5
|
+
module Validators
|
|
6
|
+
module Tags
|
|
7
|
+
# TypeSyntax validator
|
|
8
|
+
#
|
|
9
|
+
# Validates YARD type syntax using YARD's TypesExplainer::Parser. This
|
|
10
|
+
# validator ensures that type annotations can be properly parsed by YARD
|
|
11
|
+
# and follow YARD's type specification format. This validator is enabled
|
|
12
|
+
# by default.
|
|
13
|
+
#
|
|
14
|
+
# @example Bad - Invalid type syntax that YARD cannot parse
|
|
15
|
+
# # @param data [{String, Integer}] invalid hash syntax
|
|
16
|
+
# # @return [String]] extra closing bracket
|
|
17
|
+
# def process(data)
|
|
18
|
+
# end
|
|
19
|
+
#
|
|
20
|
+
# @example Good - Valid parseable YARD type syntax
|
|
21
|
+
# # @param data [Hash{String => Integer}] valid hash syntax
|
|
22
|
+
# # @return [String] correct bracket usage
|
|
23
|
+
# def process(data)
|
|
24
|
+
# end
|
|
25
|
+
#
|
|
26
|
+
# ## Configuration
|
|
27
|
+
#
|
|
28
|
+
# To disable this validator:
|
|
29
|
+
#
|
|
30
|
+
# Tags/TypeSyntax:
|
|
31
|
+
# Enabled: false
|
|
32
|
+
#
|
|
33
|
+
module TypeSyntax
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
@@ -11,15 +11,14 @@ module Yard
|
|
|
11
11
|
|
|
12
12
|
# Runs YARD stats command with proper settings on a given dir and files
|
|
13
13
|
# @param dir [String] dir where we should generate the temp docs
|
|
14
|
-
# @param
|
|
14
|
+
# @param file_list_path [String] path to temp file containing file paths (one per line)
|
|
15
15
|
# @return [Hash] shell command execution hash results
|
|
16
|
-
def yard_cmd(dir,
|
|
16
|
+
def yard_cmd(dir, file_list_path)
|
|
17
17
|
cmd = <<~CMD
|
|
18
|
-
yard stats \
|
|
18
|
+
cat #{Shellwords.escape(file_list_path)} | xargs yard stats \
|
|
19
19
|
#{shell_arguments} \
|
|
20
20
|
--compact \
|
|
21
|
-
-b #{Shellwords.escape(dir)}
|
|
22
|
-
#{escaped_file_names}
|
|
21
|
+
-b #{Shellwords.escape(dir)}
|
|
23
22
|
CMD
|
|
24
23
|
cmd = cmd.tr("\n", ' ')
|
|
25
24
|
|
|
@@ -5,7 +5,32 @@ module Yard
|
|
|
5
5
|
module Validators
|
|
6
6
|
# Validators for checking YARD warnings
|
|
7
7
|
module Warnings
|
|
8
|
-
# DuplicatedParameterName validator
|
|
8
|
+
# DuplicatedParameterName validator
|
|
9
|
+
#
|
|
10
|
+
# Detects duplicate `@param` tags for the same parameter name. If a parameter
|
|
11
|
+
# is documented multiple times, it's unclear which documentation is correct
|
|
12
|
+
# and can confuse both readers and YARD's parser. This validator is enabled
|
|
13
|
+
# by default.
|
|
14
|
+
#
|
|
15
|
+
# @example Bad - Duplicate @param tags
|
|
16
|
+
# # @param name [String] the name
|
|
17
|
+
# # @param name [Symbol] oops, documented again
|
|
18
|
+
# def process(name)
|
|
19
|
+
# end
|
|
20
|
+
#
|
|
21
|
+
# @example Good - Each parameter documented once
|
|
22
|
+
# # @param name [String] the name
|
|
23
|
+
# # @param age [Integer] the age
|
|
24
|
+
# def process(name, age)
|
|
25
|
+
# end
|
|
26
|
+
#
|
|
27
|
+
# ## Configuration
|
|
28
|
+
#
|
|
29
|
+
# To disable this validator:
|
|
30
|
+
#
|
|
31
|
+
# Warnings/DuplicatedParameterName:
|
|
32
|
+
# Enabled: false
|
|
33
|
+
#
|
|
9
34
|
module DuplicatedParameterName
|
|
10
35
|
end
|
|
11
36
|
end
|
|
@@ -11,15 +11,14 @@ module Yard
|
|
|
11
11
|
|
|
12
12
|
# Runs YARD stats command with proper settings on a given dir and files
|
|
13
13
|
# @param dir [String] dir where we should generate the temp docs
|
|
14
|
-
# @param
|
|
14
|
+
# @param file_list_path [String] path to temp file containing file paths (one per line)
|
|
15
15
|
# @return [Hash] shell command execution hash results
|
|
16
|
-
def yard_cmd(dir,
|
|
16
|
+
def yard_cmd(dir, file_list_path)
|
|
17
17
|
cmd = <<~CMD
|
|
18
|
-
yard stats \
|
|
18
|
+
cat #{Shellwords.escape(file_list_path)} | xargs yard stats \
|
|
19
19
|
#{shell_arguments} \
|
|
20
20
|
--compact \
|
|
21
|
-
-b #{Shellwords.escape(dir)}
|
|
22
|
-
#{escaped_file_names}
|
|
21
|
+
-b #{Shellwords.escape(dir)}
|
|
23
22
|
CMD
|
|
24
23
|
cmd = cmd.tr("\n", ' ')
|
|
25
24
|
|
|
@@ -5,7 +5,32 @@ module Yard
|
|
|
5
5
|
module Validators
|
|
6
6
|
# Validators for checking YARD warnings
|
|
7
7
|
module Warnings
|
|
8
|
-
# InvalidDirectiveFormat validator
|
|
8
|
+
# InvalidDirectiveFormat validator
|
|
9
|
+
#
|
|
10
|
+
# Detects malformed YARD directive syntax. Directives have specific format
|
|
11
|
+
# requirements (like `@!attribute [r] name` for read-only attributes), and
|
|
12
|
+
# this validator ensures those requirements are met. This validator is
|
|
13
|
+
# enabled by default.
|
|
14
|
+
#
|
|
15
|
+
# @example Bad - Malformed directive syntax
|
|
16
|
+
# # @!attribute name missing brackets
|
|
17
|
+
# # @!method [r] foo wrong format for method
|
|
18
|
+
# class User
|
|
19
|
+
# end
|
|
20
|
+
#
|
|
21
|
+
# @example Good - Correctly formatted directives
|
|
22
|
+
# # @!attribute [r] name
|
|
23
|
+
# # @!method foo(bar)
|
|
24
|
+
# class User
|
|
25
|
+
# end
|
|
26
|
+
#
|
|
27
|
+
# ## Configuration
|
|
28
|
+
#
|
|
29
|
+
# To disable this validator:
|
|
30
|
+
#
|
|
31
|
+
# Warnings/InvalidDirectiveFormat:
|
|
32
|
+
# Enabled: false
|
|
33
|
+
#
|
|
9
34
|
module InvalidDirectiveFormat
|
|
10
35
|
end
|
|
11
36
|
end
|
|
@@ -11,15 +11,14 @@ module Yard
|
|
|
11
11
|
|
|
12
12
|
# Runs YARD stats command with proper settings on a given dir and files
|
|
13
13
|
# @param dir [String] dir where we should generate the temp docs
|
|
14
|
-
# @param
|
|
14
|
+
# @param file_list_path [String] path to temp file containing file paths (one per line)
|
|
15
15
|
# @return [Hash] shell command execution hash results
|
|
16
|
-
def yard_cmd(dir,
|
|
16
|
+
def yard_cmd(dir, file_list_path)
|
|
17
17
|
cmd = <<~CMD
|
|
18
|
-
yard stats \
|
|
18
|
+
cat #{Shellwords.escape(file_list_path)} | xargs yard stats \
|
|
19
19
|
#{shell_arguments} \
|
|
20
20
|
--compact \
|
|
21
|
-
-b #{Shellwords.escape(dir)}
|
|
22
|
-
#{escaped_file_names}
|
|
21
|
+
-b #{Shellwords.escape(dir)}
|
|
23
22
|
CMD
|
|
24
23
|
cmd = cmd.tr("\n", ' ')
|
|
25
24
|
|
|
@@ -5,7 +5,31 @@ module Yard
|
|
|
5
5
|
module Validators
|
|
6
6
|
# Validators for checking YARD warnings
|
|
7
7
|
module Warnings
|
|
8
|
-
# InvalidTagFormat validator
|
|
8
|
+
# InvalidTagFormat validator
|
|
9
|
+
#
|
|
10
|
+
# Detects malformed YARD tag syntax. This validator checks that tags follow
|
|
11
|
+
# the correct format expected by YARD, such as proper spacing, brackets for
|
|
12
|
+
# types, and required components. This validator is enabled by default.
|
|
13
|
+
#
|
|
14
|
+
# @example Bad - Malformed tag syntax
|
|
15
|
+
# # @param name[String] missing space before type
|
|
16
|
+
# # @return [String the result missing closing bracket
|
|
17
|
+
# def process(name)
|
|
18
|
+
# end
|
|
19
|
+
#
|
|
20
|
+
# @example Good - Correctly formatted tags
|
|
21
|
+
# # @param name [String] the name
|
|
22
|
+
# # @return [String] the result
|
|
23
|
+
# def process(name)
|
|
24
|
+
# end
|
|
25
|
+
#
|
|
26
|
+
# ## Configuration
|
|
27
|
+
#
|
|
28
|
+
# To disable this validator:
|
|
29
|
+
#
|
|
30
|
+
# Warnings/InvalidTagFormat:
|
|
31
|
+
# Enabled: false
|
|
32
|
+
#
|
|
9
33
|
module InvalidTagFormat
|
|
10
34
|
end
|
|
11
35
|
end
|
|
@@ -11,15 +11,14 @@ module Yard
|
|
|
11
11
|
|
|
12
12
|
# Runs YARD stats command with proper settings on a given dir and files
|
|
13
13
|
# @param dir [String] dir where we should generate the temp docs
|
|
14
|
-
# @param
|
|
14
|
+
# @param file_list_path [String] path to temp file containing file paths (one per line)
|
|
15
15
|
# @return [Hash] shell command execution hash results
|
|
16
|
-
def yard_cmd(dir,
|
|
16
|
+
def yard_cmd(dir, file_list_path)
|
|
17
17
|
cmd = <<~CMD
|
|
18
|
-
yard stats \
|
|
18
|
+
cat #{Shellwords.escape(file_list_path)} | xargs yard stats \
|
|
19
19
|
#{shell_arguments} \
|
|
20
20
|
--compact \
|
|
21
|
-
-b #{Shellwords.escape(dir)}
|
|
22
|
-
#{escaped_file_names}
|
|
21
|
+
-b #{Shellwords.escape(dir)}
|
|
23
22
|
CMD
|
|
24
23
|
cmd = cmd.tr("\n", ' ')
|
|
25
24
|
|
|
@@ -5,7 +5,32 @@ module Yard
|
|
|
5
5
|
module Validators
|
|
6
6
|
# Validators for checking YARD warnings
|
|
7
7
|
module Warnings
|
|
8
|
-
# UnknownDirective validator
|
|
8
|
+
# UnknownDirective validator
|
|
9
|
+
#
|
|
10
|
+
# Detects usage of unrecognized YARD directives in documentation. Directives
|
|
11
|
+
# are special YARD commands (like `@!attribute`, `@!method`) that control
|
|
12
|
+
# documentation generation. This validator flags unknown directives that
|
|
13
|
+
# could indicate errors. This validator is enabled by default.
|
|
14
|
+
#
|
|
15
|
+
# @example Bad - Unknown or misspelled directive
|
|
16
|
+
# # @!attribute [r] name
|
|
17
|
+
# # @!method foo
|
|
18
|
+
# class User
|
|
19
|
+
# end
|
|
20
|
+
#
|
|
21
|
+
# @example Good - Standard YARD directives
|
|
22
|
+
# # @!attribute [r] name
|
|
23
|
+
# # @!method foo
|
|
24
|
+
# class User
|
|
25
|
+
# end
|
|
26
|
+
#
|
|
27
|
+
# ## Configuration
|
|
28
|
+
#
|
|
29
|
+
# To disable this validator:
|
|
30
|
+
#
|
|
31
|
+
# Warnings/UnknownDirective:
|
|
32
|
+
# Enabled: false
|
|
33
|
+
#
|
|
9
34
|
module UnknownDirective
|
|
10
35
|
end
|
|
11
36
|
end
|
|
@@ -8,10 +8,13 @@ module Yard
|
|
|
8
8
|
# Parser for UnknownParameterName warnings
|
|
9
9
|
class Parser < ::Yard::Lint::Parsers::TwoLineBase
|
|
10
10
|
# Set of regexps for detecting warnings reported by YARD stats
|
|
11
|
+
# YARD output format:
|
|
12
|
+
# [warn]: @param tag has unknown parameter name: ...
|
|
13
|
+
# in file `filename.rb' near line 8
|
|
11
14
|
self.regexps = {
|
|
12
15
|
general: /^\[warn\]: @param tag has unknown parameter name/,
|
|
13
16
|
message: /\[warn\]: (.*)$/,
|
|
14
|
-
location: /in file `(.*?)'
|
|
17
|
+
location: /in file `(.*?)'\s*near/,
|
|
15
18
|
line: /near line (\d+)/
|
|
16
19
|
}.freeze
|
|
17
20
|
end
|
|
@@ -11,15 +11,14 @@ module Yard
|
|
|
11
11
|
|
|
12
12
|
# Runs YARD stats command with proper settings on a given dir and files
|
|
13
13
|
# @param dir [String] dir where we should generate the temp docs
|
|
14
|
-
# @param
|
|
14
|
+
# @param file_list_path [String] path to temp file containing file paths (one per line)
|
|
15
15
|
# @return [Hash] shell command execution hash results
|
|
16
|
-
def yard_cmd(dir,
|
|
16
|
+
def yard_cmd(dir, file_list_path)
|
|
17
17
|
cmd = <<~CMD
|
|
18
|
-
yard stats \
|
|
18
|
+
cat #{Shellwords.escape(file_list_path)} | xargs yard stats \
|
|
19
19
|
#{shell_arguments} \
|
|
20
20
|
--compact \
|
|
21
|
-
-b #{Shellwords.escape(dir)}
|
|
22
|
-
#{escaped_file_names}
|
|
21
|
+
-b #{Shellwords.escape(dir)}
|
|
23
22
|
CMD
|
|
24
23
|
cmd = cmd.tr("\n", ' ')
|
|
25
24
|
|
|
@@ -5,7 +5,29 @@ module Yard
|
|
|
5
5
|
module Validators
|
|
6
6
|
# Validators for checking YARD warnings
|
|
7
7
|
module Warnings
|
|
8
|
-
# UnknownParameterName validator
|
|
8
|
+
# UnknownParameterName validator
|
|
9
|
+
#
|
|
10
|
+
# Detects `@param` tags that document parameters which don't exist in the
|
|
11
|
+
# method signature. This often occurs after refactoring when parameter names
|
|
12
|
+
# change but documentation isn't updated. This validator is enabled by default.
|
|
13
|
+
#
|
|
14
|
+
# @example Bad - @param documents non-existent parameter
|
|
15
|
+
# # @param old_name [String] this parameter doesn't exist anymore
|
|
16
|
+
# def process(new_name)
|
|
17
|
+
# end
|
|
18
|
+
#
|
|
19
|
+
# @example Good - @param matches actual parameters
|
|
20
|
+
# # @param new_name [String] the name to process
|
|
21
|
+
# def process(new_name)
|
|
22
|
+
# end
|
|
23
|
+
#
|
|
24
|
+
# ## Configuration
|
|
25
|
+
#
|
|
26
|
+
# To disable this validator:
|
|
27
|
+
#
|
|
28
|
+
# Warnings/UnknownParameterName:
|
|
29
|
+
# Enabled: false
|
|
30
|
+
#
|
|
9
31
|
module UnknownParameterName
|
|
10
32
|
end
|
|
11
33
|
end
|
|
@@ -11,15 +11,14 @@ module Yard
|
|
|
11
11
|
|
|
12
12
|
# Runs YARD stats command with proper settings on a given dir and files
|
|
13
13
|
# @param dir [String] dir where we should generate the temp docs
|
|
14
|
-
# @param
|
|
14
|
+
# @param file_list_path [String] path to temp file containing file paths (one per line)
|
|
15
15
|
# @return [Hash] shell command execution hash results
|
|
16
|
-
def yard_cmd(dir,
|
|
16
|
+
def yard_cmd(dir, file_list_path)
|
|
17
17
|
cmd = <<~CMD
|
|
18
|
-
yard stats \
|
|
18
|
+
cat #{Shellwords.escape(file_list_path)} | xargs yard stats \
|
|
19
19
|
#{shell_arguments} \
|
|
20
20
|
--compact \
|
|
21
|
-
-b #{Shellwords.escape(dir)}
|
|
22
|
-
#{escaped_file_names}
|
|
21
|
+
-b #{Shellwords.escape(dir)}
|
|
23
22
|
CMD
|
|
24
23
|
cmd = cmd.tr("\n", ' ')
|
|
25
24
|
|
|
@@ -5,7 +5,32 @@ module Yard
|
|
|
5
5
|
module Validators
|
|
6
6
|
# Validators for checking YARD warnings
|
|
7
7
|
module Warnings
|
|
8
|
-
# UnknownTag validator
|
|
8
|
+
# UnknownTag validator
|
|
9
|
+
#
|
|
10
|
+
# Detects usage of unrecognized YARD tags in documentation. This validator
|
|
11
|
+
# checks against YARD's standard tag set and flags any tags that YARD
|
|
12
|
+
# doesn't recognize, which could indicate typos or unsupported tags.
|
|
13
|
+
# This validator is enabled by default.
|
|
14
|
+
#
|
|
15
|
+
# @example Bad - Misspelled or non-existent tags
|
|
16
|
+
# # @param name [String] typo in param tag
|
|
17
|
+
# # @returns [String] should be @return not @returns
|
|
18
|
+
# def process(name)
|
|
19
|
+
# end
|
|
20
|
+
#
|
|
21
|
+
# @example Good - Standard YARD tags
|
|
22
|
+
# # @param name [String] the name
|
|
23
|
+
# # @return [String] the result
|
|
24
|
+
# def process(name)
|
|
25
|
+
# end
|
|
26
|
+
#
|
|
27
|
+
# ## Configuration
|
|
28
|
+
#
|
|
29
|
+
# To disable this validator:
|
|
30
|
+
#
|
|
31
|
+
# Warnings/UnknownTag:
|
|
32
|
+
# Enabled: false
|
|
33
|
+
#
|
|
9
34
|
module UnknownTag
|
|
10
35
|
end
|
|
11
36
|
end
|
data/lib/yard/lint/version.rb
CHANGED
data/lib/yard/lint.rb
CHANGED
data/misc/logo.png
ADDED
|
Binary file
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: yard-lint
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 1.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Maciej Mensfeld
|
|
@@ -9,6 +9,20 @@ bindir: bin
|
|
|
9
9
|
cert_chain: []
|
|
10
10
|
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
|
+
- !ruby/object:Gem::Dependency
|
|
13
|
+
name: irb
|
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
|
15
|
+
requirements:
|
|
16
|
+
- - ">="
|
|
17
|
+
- !ruby/object:Gem::Version
|
|
18
|
+
version: '0'
|
|
19
|
+
type: :runtime
|
|
20
|
+
prerelease: false
|
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
22
|
+
requirements:
|
|
23
|
+
- - ">="
|
|
24
|
+
- !ruby/object:Gem::Version
|
|
25
|
+
version: '0'
|
|
12
26
|
- !ruby/object:Gem::Dependency
|
|
13
27
|
name: yard
|
|
14
28
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -60,6 +74,7 @@ files:
|
|
|
60
74
|
- lib/yard/lint.rb
|
|
61
75
|
- lib/yard/lint/command_cache.rb
|
|
62
76
|
- lib/yard/lint/config.rb
|
|
77
|
+
- lib/yard/lint/config_generator.rb
|
|
63
78
|
- lib/yard/lint/config_loader.rb
|
|
64
79
|
- lib/yard/lint/errors.rb
|
|
65
80
|
- lib/yard/lint/formatters/progress.rb
|
|
@@ -72,6 +87,12 @@ files:
|
|
|
72
87
|
- lib/yard/lint/runner.rb
|
|
73
88
|
- lib/yard/lint/validators/base.rb
|
|
74
89
|
- lib/yard/lint/validators/config.rb
|
|
90
|
+
- lib/yard/lint/validators/documentation/markdown_syntax.rb
|
|
91
|
+
- lib/yard/lint/validators/documentation/markdown_syntax/config.rb
|
|
92
|
+
- lib/yard/lint/validators/documentation/markdown_syntax/messages_builder.rb
|
|
93
|
+
- lib/yard/lint/validators/documentation/markdown_syntax/parser.rb
|
|
94
|
+
- lib/yard/lint/validators/documentation/markdown_syntax/result.rb
|
|
95
|
+
- lib/yard/lint/validators/documentation/markdown_syntax/validator.rb
|
|
75
96
|
- lib/yard/lint/validators/documentation/undocumented_boolean_methods.rb
|
|
76
97
|
- lib/yard/lint/validators/documentation/undocumented_boolean_methods/config.rb
|
|
77
98
|
- lib/yard/lint/validators/documentation/undocumented_boolean_methods/parser.rb
|
|
@@ -89,6 +110,11 @@ files:
|
|
|
89
110
|
- lib/yard/lint/validators/documentation/undocumented_objects/parser.rb
|
|
90
111
|
- lib/yard/lint/validators/documentation/undocumented_objects/result.rb
|
|
91
112
|
- lib/yard/lint/validators/documentation/undocumented_objects/validator.rb
|
|
113
|
+
- lib/yard/lint/validators/documentation/undocumented_options.rb
|
|
114
|
+
- lib/yard/lint/validators/documentation/undocumented_options/config.rb
|
|
115
|
+
- lib/yard/lint/validators/documentation/undocumented_options/parser.rb
|
|
116
|
+
- lib/yard/lint/validators/documentation/undocumented_options/result.rb
|
|
117
|
+
- lib/yard/lint/validators/documentation/undocumented_options/validator.rb
|
|
92
118
|
- lib/yard/lint/validators/semantic/abstract_methods.rb
|
|
93
119
|
- lib/yard/lint/validators/semantic/abstract_methods/config.rb
|
|
94
120
|
- lib/yard/lint/validators/semantic/abstract_methods/messages_builder.rb
|
|
@@ -101,12 +127,30 @@ files:
|
|
|
101
127
|
- lib/yard/lint/validators/tags/api_tags/parser.rb
|
|
102
128
|
- lib/yard/lint/validators/tags/api_tags/result.rb
|
|
103
129
|
- lib/yard/lint/validators/tags/api_tags/validator.rb
|
|
130
|
+
- lib/yard/lint/validators/tags/collection_type.rb
|
|
131
|
+
- lib/yard/lint/validators/tags/collection_type/config.rb
|
|
132
|
+
- lib/yard/lint/validators/tags/collection_type/messages_builder.rb
|
|
133
|
+
- lib/yard/lint/validators/tags/collection_type/parser.rb
|
|
134
|
+
- lib/yard/lint/validators/tags/collection_type/result.rb
|
|
135
|
+
- lib/yard/lint/validators/tags/collection_type/validator.rb
|
|
136
|
+
- lib/yard/lint/validators/tags/example_syntax.rb
|
|
137
|
+
- lib/yard/lint/validators/tags/example_syntax/config.rb
|
|
138
|
+
- lib/yard/lint/validators/tags/example_syntax/messages_builder.rb
|
|
139
|
+
- lib/yard/lint/validators/tags/example_syntax/parser.rb
|
|
140
|
+
- lib/yard/lint/validators/tags/example_syntax/result.rb
|
|
141
|
+
- lib/yard/lint/validators/tags/example_syntax/validator.rb
|
|
104
142
|
- lib/yard/lint/validators/tags/invalid_types.rb
|
|
105
143
|
- lib/yard/lint/validators/tags/invalid_types/config.rb
|
|
106
144
|
- lib/yard/lint/validators/tags/invalid_types/messages_builder.rb
|
|
107
145
|
- lib/yard/lint/validators/tags/invalid_types/parser.rb
|
|
108
146
|
- lib/yard/lint/validators/tags/invalid_types/result.rb
|
|
109
147
|
- lib/yard/lint/validators/tags/invalid_types/validator.rb
|
|
148
|
+
- lib/yard/lint/validators/tags/meaningless_tag.rb
|
|
149
|
+
- lib/yard/lint/validators/tags/meaningless_tag/config.rb
|
|
150
|
+
- lib/yard/lint/validators/tags/meaningless_tag/messages_builder.rb
|
|
151
|
+
- lib/yard/lint/validators/tags/meaningless_tag/parser.rb
|
|
152
|
+
- lib/yard/lint/validators/tags/meaningless_tag/result.rb
|
|
153
|
+
- lib/yard/lint/validators/tags/meaningless_tag/validator.rb
|
|
110
154
|
- lib/yard/lint/validators/tags/option_tags.rb
|
|
111
155
|
- lib/yard/lint/validators/tags/option_tags/config.rb
|
|
112
156
|
- lib/yard/lint/validators/tags/option_tags/messages_builder.rb
|
|
@@ -119,6 +163,24 @@ files:
|
|
|
119
163
|
- lib/yard/lint/validators/tags/order/parser.rb
|
|
120
164
|
- lib/yard/lint/validators/tags/order/result.rb
|
|
121
165
|
- lib/yard/lint/validators/tags/order/validator.rb
|
|
166
|
+
- lib/yard/lint/validators/tags/redundant_param_description.rb
|
|
167
|
+
- lib/yard/lint/validators/tags/redundant_param_description/config.rb
|
|
168
|
+
- lib/yard/lint/validators/tags/redundant_param_description/messages_builder.rb
|
|
169
|
+
- lib/yard/lint/validators/tags/redundant_param_description/parser.rb
|
|
170
|
+
- lib/yard/lint/validators/tags/redundant_param_description/result.rb
|
|
171
|
+
- lib/yard/lint/validators/tags/redundant_param_description/validator.rb
|
|
172
|
+
- lib/yard/lint/validators/tags/tag_type_position.rb
|
|
173
|
+
- lib/yard/lint/validators/tags/tag_type_position/config.rb
|
|
174
|
+
- lib/yard/lint/validators/tags/tag_type_position/messages_builder.rb
|
|
175
|
+
- lib/yard/lint/validators/tags/tag_type_position/parser.rb
|
|
176
|
+
- lib/yard/lint/validators/tags/tag_type_position/result.rb
|
|
177
|
+
- lib/yard/lint/validators/tags/tag_type_position/validator.rb
|
|
178
|
+
- lib/yard/lint/validators/tags/type_syntax.rb
|
|
179
|
+
- lib/yard/lint/validators/tags/type_syntax/config.rb
|
|
180
|
+
- lib/yard/lint/validators/tags/type_syntax/messages_builder.rb
|
|
181
|
+
- lib/yard/lint/validators/tags/type_syntax/parser.rb
|
|
182
|
+
- lib/yard/lint/validators/tags/type_syntax/result.rb
|
|
183
|
+
- lib/yard/lint/validators/tags/type_syntax/validator.rb
|
|
122
184
|
- lib/yard/lint/validators/warnings/duplicated_parameter_name.rb
|
|
123
185
|
- lib/yard/lint/validators/warnings/duplicated_parameter_name/config.rb
|
|
124
186
|
- lib/yard/lint/validators/warnings/duplicated_parameter_name/parser.rb
|
|
@@ -150,6 +212,7 @@ files:
|
|
|
150
212
|
- lib/yard/lint/validators/warnings/unknown_tag/result.rb
|
|
151
213
|
- lib/yard/lint/validators/warnings/unknown_tag/validator.rb
|
|
152
214
|
- lib/yard/lint/version.rb
|
|
215
|
+
- misc/logo.png
|
|
153
216
|
- renovate.json
|
|
154
217
|
homepage: https://github.com/mensfeld/yard-lint
|
|
155
218
|
licenses:
|