Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
48 changes: 19 additions & 29 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
inherit_from: .rubocop_todo.yml
---

inherit_from: ".rubocop_todo.yml"

# The behaviour of RuboCop can be controlled via the .rubocop.yml
# configuration file. It makes it possible to enable/disable
Expand All @@ -9,19 +11,24 @@ inherit_from: .rubocop_todo.yml
# RuboCop will start looking for the configuration file in the directory
# where the inspected file is and continue its way up to the root directory.
#
# See https://github.com/rubocop-hq/rubocop/blob/master/manual/configuration.md
# See https://docs.rubocop.org/rubocop/latest/configuration.html

plugins:
- rubocop-rake
- rubocop-rspec

AllCops:
NewCops: enable

require: rubocop-rspec
Gemspec/DevelopmentDependencies:
EnforcedStyle: gemspec

Layout/LineLength:
Max: 120

# Blocks are used to structure tests and are part of the rspec dsl.
# The standard BlockLength limits are too stringent for this purpose.
Metrics/BlockLength:
ExcludedMethods:
- describe
- context
# This isn't something we need to be strict about, and the default of 5 is too low for our tests.
RSpec/MultipleMemoizedHelpers:
Max: 7

# Increase the acceptable nesting levels. While we don't want
# 4 nested contexts, it appears that the cop is also counting
Expand All @@ -31,23 +38,6 @@ Metrics/BlockLength:
RSpec/NestedGroups:
Max: 4

# Pending cops in 0.83 can be removed once enabled in bulk
# see https://docs.rubocop.org/en/latest/versioning/:
Layout/SpaceAroundMethodCallOperator:
Enabled: true
Lint/RaiseException:
Enabled: true
Lint/StructNewOverride:
Enabled: true
Style/ExponentialNotation:
Enabled: true
Style/HashEachMethods:
Enabled: true
Style/HashTransformKeys:
Enabled: true
Style/HashTransformValues:
Enabled: true
Layout/EmptyLinesAroundAttributeAccessor:
Enabled: true
Style/SlicingWithRange:
Enabled: true
# The single-line syntax can be clearer than the multi-line version for multiple definitions
Style/EmptyClassDefinition:
Enabled: false
25 changes: 20 additions & 5 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,27 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2023-09-22 13:23:22 UTC using RuboCop version 1.56.3.
# on 2026-04-29 17:06:59 UTC using RuboCop version 1.86.1.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 13
# Configuration parameters: AllowSubject.
RSpec/MultipleMemoizedHelpers:
Max: 7
# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
Gemspec/RequireMFA:
Exclude:
- 'record_loader.gemspec'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: MinBodyLength, AllowConsecutiveConditionals.
Style/GuardClause:
Exclude:
- 'record_loader.gemspec'

# Offense count: 3
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/ReduceToHash:
Exclude:
- 'lib/generators/record_loader/record_loader_generator.rb'
- 'lib/record_loader.rb'
65 changes: 33 additions & 32 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,26 @@ PATH
GEM
remote: https://rubygems.org/
specs:
ast (2.4.2)
base64 (0.1.1)
ast (2.4.3)
coderay (1.1.3)
diff-lcs (1.5.0)
docile (1.4.0)
json (2.6.3)
language_server-protocol (3.17.0.3)
docile (1.4.1)
json (2.19.4)
language_server-protocol (3.17.0.5)
lint_roller (1.1.0)
method_source (1.0.0)
parallel (1.23.0)
parser (3.2.2.3)
parallel (1.28.0)
parser (3.3.11.1)
ast (~> 2.4.1)
racc
prism (1.9.0)
pry (0.14.2)
coderay (~> 1.1)
method_source (~> 1.0)
racc (1.7.1)
racc (1.8.1)
rainbow (3.1.1)
rake (13.0.6)
regexp_parser (2.8.1)
rexml (3.2.6)
regexp_parser (2.12.0)
rspec (3.12.0)
rspec-core (~> 3.12.0)
rspec-expectations (~> 3.12.0)
Expand All @@ -39,37 +39,37 @@ GEM
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-support (3.12.1)
rubocop (1.56.3)
base64 (~> 0.1.1)
rubocop (1.86.1)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.2.2.3)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.1.0)
parallel (>= 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.28.1, < 2.0)
regexp_parser (>= 2.9.3, < 3.0)
rubocop-ast (>= 1.49.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.29.0)
parser (>= 3.2.1.0)
rubocop-capybara (2.19.0)
rubocop (~> 1.41)
rubocop-factory_bot (2.24.0)
rubocop (~> 1.33)
rubocop-rspec (2.24.0)
rubocop (~> 1.33)
rubocop-capybara (~> 2.17)
rubocop-factory_bot (~> 2.22)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.49.1)
parser (>= 3.3.7.2)
prism (~> 1.7)
rubocop-rake (0.7.1)
lint_roller (~> 1.1)
rubocop (>= 1.72.1)
rubocop-rspec (3.9.0)
lint_roller (~> 1.1)
rubocop (~> 1.81)
ruby-progressbar (1.13.0)
simplecov (0.22.0)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-html (0.12.3)
simplecov-html (0.13.2)
simplecov-lcov (0.9.0)
simplecov_json_formatter (0.1.4)
unicode-display_width (2.4.2)
unicode-display_width (3.2.0)
unicode-emoji (~> 4.1)
unicode-emoji (4.2.0)
yard (0.9.34)

PLATFORMS
Expand All @@ -82,7 +82,8 @@ DEPENDENCIES
record_loader!
rspec (~> 3.12)
rubocop (~> 1.56)
rubocop-rspec (~> 2.24)
rubocop-rake (~> 0.7.1)
rubocop-rspec (~> 3.0)
simplecov (~> 0.22)
simplecov-lcov (~> 0.9)
yard (~> 0.9)
Expand Down
3 changes: 2 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# frozen_string_literal: true

# We add preflight to the release task pre-requisites before loading in the
# bundler/gem_tasks to ensure that it runs first. This is becuase 'release' is
# bundler/gem_tasks to ensure that it runs first. This is because 'release' is
# actually composed entirely of pre-requisites and so would otherwise end up
# running the pre-flight tasks AFTER everything else
desc 'Runs the preflight checklist before building a release'
task release: :preflight

require 'bundler/gem_tasks'
Expand Down
6 changes: 3 additions & 3 deletions record_loader.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ Gem::Specification.new do |spec|
spec.metadata['source_code_uri'] = 'https://www.github.com/sanger/record_loader'
# spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here."
else
raise 'RubyGems 2.0 or newer is required to protect against ' \
'public gem pushes.'
raise 'RubyGems 2.0 or newer is required to protect against public gem pushes.'
end

# Specify which files should be added to the gem when it is released.
Expand All @@ -46,7 +45,8 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'rake', '~> 13.0'
spec.add_development_dependency 'rspec', '~> 3.12'
spec.add_development_dependency 'rubocop', '~> 1.56'
spec.add_development_dependency 'rubocop-rspec', '~> 2.24'
spec.add_development_dependency 'rubocop-rake', '~> 0.7.1'
spec.add_development_dependency 'rubocop-rspec', '~> 3.0'
spec.add_development_dependency 'simplecov', '~> 0.22'
spec.add_development_dependency 'simplecov-lcov', '~> 0.9'
spec.add_development_dependency 'yard', '~> 0.9'
Expand Down
6 changes: 3 additions & 3 deletions spec/record_loader/attribute_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

require 'record_loader/attribute'

RSpec.describe RecordLoader::Attribute, type: :model, loader: true do
RSpec.describe RecordLoader::Attribute, :loader, type: :model do
subject(:attribute) do
described_class.new(name, type, default)
end
Expand Down Expand Up @@ -178,13 +178,13 @@
context 'without a default' do
let(:default) { nil }

it { is_expected.to eq false }
it { is_expected.to be false }
end

context 'with a default' do
let(:default) { true }

it { is_expected.to eq true }
it { is_expected.to be true }
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/record_loader/base_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

RSpec.describe RecordLoader::Base, type: :model, loader: true do
RSpec.describe RecordLoader::Base, :loader, type: :model do
subject(:record_loader) do
allow(ENV).to receive(:fetch).with('WIP', '').and_return(wip_flags)
custom_subclass.new(**options)
Expand Down
2 changes: 1 addition & 1 deletion spec/record_loader_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

RSpec.describe RecordLoader do
it 'has a version number' do
expect(RecordLoader::VERSION).not_to be nil
expect(RecordLoader::VERSION).not_to be_nil
end
end
Loading