Skip to content

Commit 19e3f24

Browse files
committed
Disable Rubocop Metrics/BlockLength for spec files
RSpec spec files can contain long blocks easily because of the outher describe methods. So this rule makes not too much sense for these files.
1 parent a78ca7d commit 19e3f24

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

.rubocop.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,7 @@ AllCops:
66
- 'vendor/**/*'
77
- 'spec/fixtures/**/*'
88
- 'tmp/**/*'
9+
10+
Metrics/BlockLength:
11+
Exclude:
12+
- 'spec/**/*.rb'

spec/lib/annotate/annotate_models_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
require 'active_support/core_ext/string'
66
require 'files'
77

8-
describe AnnotateModels do # rubocop:disable Metrics/BlockLength
8+
describe AnnotateModels do
99
MAGIC_COMMENTS = [
1010
'# encoding: UTF-8',
1111
'# coding: UTF-8',
@@ -1383,7 +1383,7 @@ def self.when_called_with(options = {})
13831383
end
13841384
end
13851385

1386-
describe '.get_model_class' do # rubocop:disable Metrics/BlockLength
1386+
describe '.get_model_class' do
13871387
before :all do
13881388
require 'tmpdir'
13891389
AnnotateModels.model_dir = Dir.mktmpdir('annotate_models')

spec/lib/annotate/parser_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
require_relative '../../spec_helper'
22

33
module Annotate # rubocop:disable Metrics/ModuleLength
4-
describe Parser do # rubocop:disable Metrics/BlockLength
4+
describe Parser do
55
before(:example) do
66
ENV.clear
77
end

0 commit comments

Comments
 (0)