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

Skip to content

Commit 62e7259

Browse files
authored
Merge pull request rubocop#711 from rubocop-hq/fix-manual-generation
Load only RuboCop-RSpec config when generating cops documentation
2 parents b3507f7 + c383085 commit 62e7259

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ source 'https://rubygems.org'
22

33
gemspec
44

5+
gem 'rubocop', '< 0.60.0'
6+
57
local_gemfile = 'Gemfile.local'
68

79
if File.exist?(local_gemfile)

manual/cops_rails.md

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 4 deletions
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)