Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: rubocop fixes and deprecation of .rubocop_todo.yml file #10

Merged
merged 25 commits into from
Apr 11, 2024
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
418fca2
fix: rubocop warnings and update TODOs
davidjrice Apr 11, 2024
89a7732
build: change rubocop config to prefer double quotes for string literals
davidjrice Apr 11, 2024
1bedd48
build: add specific ignore for rubocop Layout/LineLength offence
davidjrice Apr 11, 2024
cd244a4
fix: rubocop Gemspec/DuplicatedAssignment offence
davidjrice Apr 11, 2024
7b4aae7
fix: rubocop Gemspec/RequiredRubyVersion offence
davidjrice Apr 11, 2024
5b91c8a
build: remove Layout/LineLength override from rubocop todo
davidjrice Apr 11, 2024
dd67ed6
fix: gemspec definition, use spec as variable for clarity
davidjrice Apr 11, 2024
175c679
fix: rubocop Style/ClassVars offence
davidjrice Apr 11, 2024
566f3dc
fix: rubocop Naming/MethodParameterName offence and default to using …
davidjrice Apr 11, 2024
e391e5d
build: add specific disable for rubocop Metrics/BlockLength in specs
davidjrice Apr 11, 2024
dccd254
build: add specific ignore for rubocop Metrics/ClassLength offence
davidjrice Apr 11, 2024
6b19782
build: add specific ignore for rubocop Metrics/ModuleLength offence
davidjrice Apr 11, 2024
15ae51a
build: add specific ignore for rubocop Metrics/PerceivedComplexity of…
davidjrice Apr 11, 2024
ad205f4
build: add specific ignore for rubocop Metrics/CyclomaticComplexity o…
davidjrice Apr 11, 2024
3aa30b3
build: add specific ignores for rubocop Metrics/AbcSize offences
davidjrice Apr 11, 2024
9baa521
build: add specific ignore for rubocop Metrics/MethodLength offence
davidjrice Apr 11, 2024
18b7888
docs: add top-level documentation comments to fix rubocop Style/Docum…
davidjrice Apr 11, 2024
3958d29
build: remove rubocop TODO file as all offences are fixed or specific…
davidjrice Apr 11, 2024
e64f32c
build: remove rubocop todo file reference
davidjrice Apr 11, 2024
e07b4b4
build: add rubocop to the default rake task
davidjrice Apr 11, 2024
fb63d18
bump: version 1.0.1
davidjrice Apr 11, 2024
2dfbaa0
fix: gemspec syntax
davidjrice Apr 11, 2024
528be5b
fix: rubocop Style/StringLiterals offence
davidjrice Apr 11, 2024
e298bdb
build: specify version numbers for dev dependencies rake and rspec
davidjrice Apr 11, 2024
2c1156a
build: ignore .gem files
davidjrice Apr 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: rubocop Naming/MethodParameterName offence and default to using …
…*attrs
davidjrice committed Apr 11, 2024
commit 566f3dcc5726926b864ada85134bd2b809f23be5
7 changes: 0 additions & 7 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -42,13 +42,6 @@ Metrics/ModuleLength:
Metrics/PerceivedComplexity:
Max: 16

# Offense count: 1
# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
# AllowedNames: as, at, by, cc, db, id, if, in, io, ip, of, on, os, pp, to
Naming/MethodParameterName:
Exclude:
- 'lib/atco/location.rb'

# Offense count: 4
# Configuration parameters: AllowedConstants.
Style/Documentation:
4 changes: 2 additions & 2 deletions lib/atco/journey.rb
Original file line number Diff line number Diff line change
@@ -64,7 +64,7 @@ def parse_boolean_int(string)
string && string == "1"
end

def to_json(*args)
def to_json(*attrs)
{
vehicle_type: @vehicle_type,
registration_number: @registration_number,
@@ -78,7 +78,7 @@ def to_json(*args)
route_direction: @route_direction,
bank_holidays: @bank_holidays,
stops: @stops
}.to_json(*args)
}.to_json(*attrs)
end
end
end
4 changes: 2 additions & 2 deletions lib/atco/location.rb
Original file line number Diff line number Diff line change
@@ -12,14 +12,14 @@ def initialize(location_header, additional_location_information)
@gazeteer_code = location_header[:gazetteer_code]
end

def to_json(*a)
def to_json(*attrs)
{
name: @name,
identifier: @identifier,
easting: @easting,
northing: @northing,
gazeteer_code: @gazeteer_code
}.to_json(*a)
}.to_json(*attrs)
end
end
end
4 changes: 2 additions & 2 deletions lib/atco/stop.rb
Original file line number Diff line number Diff line change
@@ -26,15 +26,15 @@ def initialize(data)
@record_identity = data[:record_identity]
end

def to_json(*args)
def to_json(*attrs)
{
record_identity: @record_identity,
location: @location,
published_departure_time: @published_departure_time,
timing_point_indicator: @timing_point_indicator,
fare_stage_indicator: @fare_stage_indicator,
bay_number: @bay_number
}.to_json(*args)
}.to_json(*attrs)
end
end
end