yard-lint 1.13.1 → 1.14.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 +16 -0
- data/README.md +15 -8
- data/bin/yard-lint +24 -34
- data/lib/yard/lint/contracts/base.rb +20 -6
- data/lib/yard/lint/contracts/cli_options.rb +62 -0
- data/lib/yard/lint/contracts/config.rb +1 -1
- data/lib/yard/lint/executor/in_process_registry.rb +79 -9
- data/lib/yard/lint/formatters/relative_path.rb +32 -0
- data/lib/yard/lint/formatters/sarif.rb +2 -12
- data/lib/yard/lint/result_builder.rb +44 -15
- data/lib/yard/lint/results/aggregate.rb +4 -2
- data/lib/yard/lint/runner.rb +16 -14
- data/lib/yard/lint/stats_calculator.rb +59 -37
- data/lib/yard/lint/todo_generator.rb +33 -21
- data/lib/yard/lint/validators/documentation/undocumented_boolean_methods/messages_builder.rb +23 -0
- data/lib/yard/lint/validators/documentation/undocumented_boolean_methods/result.rb +1 -2
- data/lib/yard/lint/validators/documentation/undocumented_method_arguments/messages_builder.rb +10 -3
- data/lib/yard/lint/validators/documentation/undocumented_method_arguments/parser.rb +22 -3
- data/lib/yard/lint/validators/documentation/undocumented_method_arguments/validator.rb +46 -8
- data/lib/yard/lint/validators/documentation/undocumented_objects/parser.rb +15 -13
- data/lib/yard/lint/validators/documentation/undocumented_objects/result.rb +6 -1
- data/lib/yard/lint/validators/documentation/undocumented_objects/validator.rb +25 -2
- data/lib/yard/lint/validators/tags/example_style/validator.rb +7 -2
- data/lib/yard/lint/version.rb +1 -1
- data/lib/yard/lint.rb +15 -14
- metadata +4 -1
|
@@ -10,6 +10,11 @@ module Yard
|
|
|
10
10
|
# Enable in-process execution with all visibility
|
|
11
11
|
in_process visibility: :all
|
|
12
12
|
|
|
13
|
+
class << self
|
|
14
|
+
# @return [Boolean, nil] whether the missing linter warning was already printed
|
|
15
|
+
attr_accessor :warned_about_linter
|
|
16
|
+
end
|
|
17
|
+
|
|
13
18
|
# Execute query for a single object during in-process execution.
|
|
14
19
|
# Checks code style in @example tags using RuboCop or StandardRB.
|
|
15
20
|
# @param object [YARD::CodeObjects::Base] the code object to query
|
|
@@ -74,10 +79,10 @@ module Yard
|
|
|
74
79
|
|
|
75
80
|
# Warn once about missing linter (class-level tracking)
|
|
76
81
|
def warn_once_about_missing_linter
|
|
77
|
-
return if self.class.
|
|
82
|
+
return if self.class.warned_about_linter
|
|
78
83
|
|
|
79
84
|
warn '[YARD::Lint] ExampleStyle validator enabled but no linter (RuboCop/StandardRB) found. Skipping.'
|
|
80
|
-
self.class.
|
|
85
|
+
self.class.warned_about_linter = true
|
|
81
86
|
end
|
|
82
87
|
end
|
|
83
88
|
end
|
data/lib/yard/lint/version.rb
CHANGED
data/lib/yard/lint.rb
CHANGED
|
@@ -55,6 +55,21 @@ module Yard
|
|
|
55
55
|
runner.run
|
|
56
56
|
end
|
|
57
57
|
|
|
58
|
+
# Expand path/glob patterns into an array of files
|
|
59
|
+
# @api private
|
|
60
|
+
# @param path [String, Array<String>] path or array of paths
|
|
61
|
+
# @param config [Yard::Lint::Config] configuration object
|
|
62
|
+
# @return [Array<String>] array of absolute file paths
|
|
63
|
+
def expand_path(path, config)
|
|
64
|
+
files = discover_ruby_files(path)
|
|
65
|
+
|
|
66
|
+
# Convert to absolute paths for YARD
|
|
67
|
+
files = files.map { |file| File.expand_path(file) }
|
|
68
|
+
|
|
69
|
+
# Filter out excluded files
|
|
70
|
+
files.reject { |file| config.excluded_path?(file, config.exclude) }
|
|
71
|
+
end
|
|
72
|
+
|
|
58
73
|
private
|
|
59
74
|
|
|
60
75
|
# Load configuration from file or auto-detect
|
|
@@ -93,20 +108,6 @@ module Yard
|
|
|
93
108
|
git_files.reject { |file| config.excluded_path?(file, config.exclude) }
|
|
94
109
|
end
|
|
95
110
|
|
|
96
|
-
# Expand path/glob patterns into an array of files
|
|
97
|
-
# @param path [String, Array<String>] path or array of paths
|
|
98
|
-
# @param config [Yard::Lint::Config] configuration object
|
|
99
|
-
# @return [Array<String>] array of absolute file paths
|
|
100
|
-
def expand_path(path, config)
|
|
101
|
-
files = discover_ruby_files(path)
|
|
102
|
-
|
|
103
|
-
# Convert to absolute paths for YARD
|
|
104
|
-
files = files.map { |file| File.expand_path(file) }
|
|
105
|
-
|
|
106
|
-
# Filter out excluded files
|
|
107
|
-
files.reject { |file| config.excluded_path?(file, config.exclude) }
|
|
108
|
-
end
|
|
109
|
-
|
|
110
111
|
# Discover Ruby files from path/glob patterns
|
|
111
112
|
# @param path [String, Array<String>] path or array of paths
|
|
112
113
|
# @return [Array<String>] array of discovered Ruby file paths
|
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: 1.
|
|
4
|
+
version: 1.14.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Maciej Mensfeld
|
|
@@ -62,6 +62,7 @@ files:
|
|
|
62
62
|
- lib/yard/lint/contractable/rule.rb
|
|
63
63
|
- lib/yard/lint/contracts/base.rb
|
|
64
64
|
- lib/yard/lint/contracts/category.rb
|
|
65
|
+
- lib/yard/lint/contracts/cli_options.rb
|
|
65
66
|
- lib/yard/lint/contracts/config.rb
|
|
66
67
|
- lib/yard/lint/contracts/validator.rb
|
|
67
68
|
- lib/yard/lint/errors.rb
|
|
@@ -72,6 +73,7 @@ files:
|
|
|
72
73
|
- lib/yard/lint/explainer.rb
|
|
73
74
|
- lib/yard/lint/ext/irb_notifier_shim.rb
|
|
74
75
|
- lib/yard/lint/formatters/progress.rb
|
|
76
|
+
- lib/yard/lint/formatters/relative_path.rb
|
|
75
77
|
- lib/yard/lint/formatters/sarif.rb
|
|
76
78
|
- lib/yard/lint/git.rb
|
|
77
79
|
- lib/yard/lint/parsers/base.rb
|
|
@@ -150,6 +152,7 @@ files:
|
|
|
150
152
|
- lib/yard/lint/validators/documentation/underfilled_lines/validator.rb
|
|
151
153
|
- lib/yard/lint/validators/documentation/undocumented_boolean_methods.rb
|
|
152
154
|
- lib/yard/lint/validators/documentation/undocumented_boolean_methods/config.rb
|
|
155
|
+
- lib/yard/lint/validators/documentation/undocumented_boolean_methods/messages_builder.rb
|
|
153
156
|
- lib/yard/lint/validators/documentation/undocumented_boolean_methods/parser.rb
|
|
154
157
|
- lib/yard/lint/validators/documentation/undocumented_boolean_methods/result.rb
|
|
155
158
|
- lib/yard/lint/validators/documentation/undocumented_boolean_methods/validator.rb
|