Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit db0d2f3

Browse files
author
Maxim Krizhanovski
committed
Load only RuboCop-RSpec config when generating cops documentation
1 parent b3507f7 commit db0d2f3

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

manual/cops_rails.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
Enabled by default | Supports autocorrection
66
--- | ---
7-
Disabled | Yes
7+
Enabled | Yes
88

99
Enforces use of symbolic or numeric value to describe HTTP status.
1010

tasks/cops_documentation.rake

+2-4
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ task generate_cops_documentation: :yard_for_generate_documentation do
237237

238238
def main
239239
cops = RuboCop::Cop::Cop.registry
240-
config = RuboCop::ConfigLoader.default_configuration
240+
config = RuboCop::ConfigLoader.load_file('config/default.yml')
241241

242242
YARD::Registry.load!
243243
cops.departments.sort!.each do |department|
@@ -260,15 +260,13 @@ task documentation_syntax_check: :yard_for_generate_documentation do
260260
YARD::Registry.load!
261261
cops = RuboCop::Cop::Cop.registry
262262
cops.each do |cop|
263-
next unless %i[RSpec Capybara FactoryBot].include?(cop.department)
264-
265263
examples = YARD::Registry.all(:class).find do |code_object|
266264
next unless RuboCop::Cop::Badge.for(code_object.to_s) == cop.badge
267265

268266
break code_object.tags('example')
269267
end
270268

271-
examples.each do |example|
269+
examples.to_a.each do |example|
272270
begin
273271
buffer = Parser::Source::Buffer.new('<code>', 1)
274272
buffer.source = example.text

0 commit comments

Comments
 (0)