Skip to content

Commit fd6f386

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 e42a3ac commit fd6f386

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
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: 1 addition & 1 deletion
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
def mock_index(name, params = {})
1010
double('IndexKeyDefinition',
1111
name: name,

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)