Skip to content

Commit 7384088

Browse files
authored
Merge pull request #103 from SuperGoodSoft/alistair/ci-check
Fix CI
2 parents 1e0ea92 + 823fc70 commit 7384088

File tree

80 files changed

+683
-695
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+683
-695
lines changed

.git-blame-ignore-revs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# .git-blame-ignore-revs
2+
# Convert to standardrb
3+
18cd5bfae471a37917a8e4cb8cad341067716648

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ jobs:
2222
ruby-version: "3.4"
2323
bundler-cache: true
2424
- name: Lint Ruby files
25-
run: bundle exec rubocop -ESP
25+
run: bundle exec standardrb

.github/workflows/test.yml

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,33 +22,20 @@ jobs:
2222
- "7.2"
2323
- "8.0"
2424
ruby-version:
25-
- "3.2"
25+
- "3.3"
2626
- "3.4"
2727
solidus-branch:
28-
- "v4.1"
29-
- "v4.2"
30-
- "v4.3"
3128
- "v4.4"
3229
- "v4.5"
30+
- "v4.6"
31+
- "main"
3332
database:
3433
- "postgresql"
3534
- "mysql"
3635
- "sqlite"
3736
exclude:
38-
- rails-version: "7.2"
39-
solidus-branch: "v4.3"
40-
- rails-version: "7.2"
41-
solidus-branch: "v4.2"
42-
- rails-version: "7.2"
43-
solidus-branch: "v4.1"
44-
- ruby-version: "3.4"
45-
rails-version: "7.0"
46-
- ruby-version: "3.2"
47-
rails-version: "8.0"
48-
- solidus-branch: "v4.3"
49-
rails-version: "8.0"
50-
- solidus-branch: "v4.4"
51-
rails-version: "8.0"
37+
- rails-version: "8.0"
38+
solidus-branch: "v4.4"
5239
steps:
5340
- uses: actions/checkout@v4
5441
- name: Run extension tests

.rubocop.yml

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,5 @@
11
require:
2-
- solidus_dev_support/rubocop
2+
- standard
33

4-
AllCops:
5-
NewCops: disable
6-
7-
Rails/SkipsModelValidations:
8-
Enabled: false
9-
10-
RSpec/MultipleExpectations:
11-
Enabled: false
12-
13-
RSpec/MultipleMemoizedHelpers:
14-
Enabled: false
15-
16-
RSpec/NestedGroups:
17-
Max: 4
4+
inherit_gem:
5+
standard: config/base.yml

Gemfile

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,40 @@
11
# frozen_string_literal: true
22

3-
source 'https://rubygems.org'
3+
source "https://rubygems.org"
44
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
55

6-
branch = ENV.fetch('SOLIDUS_BRANCH', 'main')
7-
solidus_git, solidus_frontend_git = if (branch == 'main') || (branch >= 'v3.2')
8-
%w[solidusio/solidus solidusio/solidus_frontend]
9-
else
10-
%w[solidusio/solidus] * 2
11-
end
12-
gem 'solidus', github: solidus_git, branch: branch
13-
gem 'solidus_frontend', github: solidus_frontend_git, branch: branch
6+
branch = ENV.fetch("SOLIDUS_BRANCH", "main")
147

15-
# Needed to help Bundler figure out how to resolve dependencies,
16-
# otherwise it takes forever to resolve them.
17-
# See https://github.com/bundler/bundler/issues/6677
18-
gem 'rails', '>0.a'
8+
gem "solidus", github: "solidusio/solidus", branch: branch
9+
10+
# The `solidus_frontend` gem is deprecated and isn't expected to have major
11+
# version updates after v3.2.
12+
if branch >= "v3.2"
13+
gem "solidus_frontend"
14+
elsif branch == "main"
15+
gem "solidus_frontend", github: "solidusio/solidus_frontend", branch: branch
16+
else
17+
gem "solidus_frontend", github: "solidusio/solidus", branch: branch
18+
end
19+
20+
rails_requirement_string = ENV.fetch("RAILS_VERSION", "~> 8.0")
21+
gem "rails", rails_requirement_string
22+
23+
gem "state_machines", "0.6.0"
1924

2025
# Provides basic authentication functionality for testing parts of your engine
21-
gem 'solidus_auth_devise'
26+
gem "solidus_auth_devise"
2227

23-
case ENV['DB']
24-
when 'mysql'
25-
gem 'mysql2'
26-
when 'postgresql'
27-
gem 'pg'
28+
case ENV["DB"]
29+
when "mysql"
30+
gem "mysql2"
31+
when "postgresql"
32+
gem "pg"
2833
else
29-
gem 'sqlite3'
34+
rails_version = Gem::Requirement.new(rails_requirement_string).requirements[0][1]
35+
sqlite_version = (rails_version < Gem::Version.new(7.2)) ? "~> 1.4" : "~> 2.0"
36+
37+
gem "sqlite3", sqlite_version
3038
end
3139

3240
gemspec
@@ -36,4 +44,4 @@ gemspec
3644
#
3745
# We use `send` instead of calling `eval_gemfile` to work around an issue with
3846
# how Dependabot parses projects: https://github.com/dependabot/dependabot-core/issues/1658.
39-
send(:eval_gemfile, 'Gemfile-local') if File.exist? 'Gemfile-local'
47+
send(:eval_gemfile, "Gemfile-local") if File.exist? "Gemfile-local"

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,10 @@ bin/setup
177177
bin/rake
178178
```
179179

180-
To run [Rubocop](https://github.com/bbatsov/rubocop) static code analysis run
180+
To run [Standard](https://github.com/standardrb/standard)
181181

182182
```shell
183-
bundle exec rubocop
183+
bundle exec standardrb --fix
184184
```
185185

186186
When testing your application's integration with this extension you may use its factories.

Rakefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# frozen_string_literal: true
22

3-
require 'solidus_dev_support/rake_tasks'
3+
require "solidus_dev_support/rake_tasks"
44
SolidusDevSupport::RakeTasks.install
55

6-
task default: 'extension:specs'
6+
task default: "extension:specs"

app/controllers/spree/admin/solidus_importer/import_rows_controller.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ module SolidusImporter
66
class ImportRowsController < BaseController
77
before_action :load_data, only: %i[show]
88

9-
def show; end
9+
def show
10+
end
1011

1112
private
1213

@@ -15,8 +16,8 @@ def load_data
1516
return unless (@log_entry = ::Spree::LogEntry.find_by(source: @import_row))
1617

1718
@log_details = JSON.parse(@log_entry.details)
18-
target_class = @log_details['class_name']&.constantize
19-
@target_entity = target_class.find_by(id: @log_details['id']) if target_class
19+
target_class = @log_details["class_name"]&.constantize
20+
@target_entity = target_class.find_by(id: @log_details["id"]) if target_class
2021
end
2122
end
2223
end

app/controllers/spree/admin/solidus_importer/imports_controller.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ class ImportsController < ResourceController
1010
def index
1111
@search = ::SolidusImporter::Import.ransack(params[:q])
1212
@imports = @search.result(distinct: true)
13-
.page(params[:page])
14-
.per(params[:per_page] || Spree::Config[:orders_per_page])
15-
.order(id: :desc)
13+
.page(params[:page])
14+
.per(params[:per_page] || Spree::Config[:orders_per_page])
15+
.order(id: :desc)
1616
end
1717

1818
def show

app/jobs/solidus_importer/import_job.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class ImportJob < ApplicationJob
77
retry_on ActiveRecord::Deadlocked
88

99
def perform(source, import_type = nil)
10-
raise ArgumentError, 'Missing import source' unless source
10+
raise ArgumentError, "Missing import source" unless source
1111

1212
if source.is_a?(Integer)
1313
perform_import_from_model(source)

0 commit comments

Comments
 (0)