Skip to content

Commit

Permalink
Change end_pos from 1 to 0
Browse files Browse the repository at this point in the history
  • Loading branch information
ybiquitous committed Oct 2, 2020
1 parent f87c817 commit 7e3b3da
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/rubocop/cop/offense.rb
Expand Up @@ -79,7 +79,7 @@ def size
end
private_constant :PseudoSourceRange

NO_LOCATION = PseudoSourceRange.new(1, 0, '', 0, 1).freeze
NO_LOCATION = PseudoSourceRange.new(1, 0, '', 0, 0).freeze

# @api private
def initialize(severity, location, message, cop_name, # rubocop:disable Metrics/ParameterLists
Expand Down
4 changes: 2 additions & 2 deletions spec/rubocop/cop/offense_spec.rb
Expand Up @@ -185,8 +185,8 @@ def Foo
let(:location) { described_class::NO_LOCATION }

it 'returns a location with valid size and length' do
expect(offense.location.size).to eq 1
expect(offense.location.length).to eq 1
expect(offense.location.size).to eq 0
expect(offense.location.length).to eq 0
end

it 'returns a line' do
Expand Down
2 changes: 1 addition & 1 deletion spec/rubocop/formatter/json_formatter_spec.rb
Expand Up @@ -167,7 +167,7 @@
start_column: 1,
last_line: 1,
last_column: 0,
length: 1,
length: 0,
line: 1,
column: 1
})
Expand Down

0 comments on commit 7e3b3da

Please sign in to comment.