solidus_dev_support 2.11.0 → 2.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.git-blame-ignore-revs +3 -0
- data/.rubocop.yml +4 -55
- data/.standard.yml +2 -0
- data/Gemfile +11 -11
- data/README.md +1 -3
- data/bin/setup +5 -5
- data/bin/solidus +1 -1
- data/exe/solidus +1 -1
- data/lib/solidus_dev_support/extension.rb +38 -38
- data/lib/solidus_dev_support/rake_tasks.rb +18 -18
- data/lib/solidus_dev_support/rspec/capybara.rb +5 -5
- data/lib/solidus_dev_support/rspec/coverage.rb +6 -6
- data/lib/solidus_dev_support/rspec/feature_helper.rb +2 -2
- data/lib/solidus_dev_support/rspec/rails_helper.rb +14 -14
- data/lib/solidus_dev_support/rspec/spec_helper.rb +2 -2
- data/lib/solidus_dev_support/rubocop/config.yml +11 -80
- data/lib/solidus_dev_support/solidus_command.rb +10 -10
- data/lib/solidus_dev_support/templates/extension/Rakefile +2 -2
- data/lib/solidus_dev_support/templates/extension/bin/rails-sandbox +4 -4
- data/lib/solidus_dev_support/testing_support/factories.rb +5 -5
- data/lib/solidus_dev_support/version.rb +1 -1
- data/lib/solidus_dev_support.rb +1 -1
- data/solidus_dev_support.gemspec +28 -32
- metadata +20 -67
- data/.rubocop-https---relaxed-ruby-style-rubocop-yml +0 -153
- data/spec/features/create_extension_spec.rb +0 -193
- data/spec/lib/extension_spec.rb +0 -69
- data/spec/spec_helper.rb +0 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c49ae4d2deb84c0553914b4f61ede1fc0b9cd9a75e70059e62c5b73663b81a20
|
4
|
+
data.tar.gz: 19a09ea4d8124daddd02a97e704a1a05a3899e54e2dbebd85f5b1a0f7183ae5f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a21b8d5d4f1c8721ba209d4567635845ce3a5e5de263b835efc643f5dc01fe08595fd99cf7eb6834fdfa58b51c462f01d4d48092bcd40b56a06f359430a47713
|
7
|
+
data.tar.gz: 670466076e0920328af99f84e9a2910a36f7702af598aae33637d6b2211038547fd7a9f8a4e77a455c79a15393a9aa7fc4bbc70266e9aac5d386b25108ff040e
|
data/.rubocop.yml
CHANGED
@@ -1,59 +1,8 @@
|
|
1
|
-
|
2
|
-
-
|
1
|
+
require:
|
2
|
+
- standard
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
Layout/EmptyLinesAroundAttributeAccessor:
|
7
|
-
Enabled: true
|
8
|
-
Layout/SpaceAroundMethodCallOperator:
|
9
|
-
Enabled: true
|
10
|
-
Lint/DeprecatedOpenSSLConstant:
|
11
|
-
Enabled: true
|
12
|
-
Lint/MixedRegexpCaptureTypes:
|
13
|
-
Enabled: true
|
14
|
-
Lint/RaiseException:
|
15
|
-
Enabled: true
|
16
|
-
Lint/StructNewOverride:
|
17
|
-
Enabled: true
|
18
|
-
Style/AccessorGrouping:
|
19
|
-
Enabled: true
|
20
|
-
Style/BisectedAttrAccessor:
|
21
|
-
Enabled: true
|
22
|
-
Style/ExponentialNotation:
|
23
|
-
Enabled: true
|
24
|
-
Style/HashEachMethods:
|
25
|
-
Enabled: true
|
26
|
-
Style/HashTransformKeys:
|
27
|
-
Enabled: true
|
28
|
-
Style/HashTransformValues:
|
29
|
-
Enabled: true
|
30
|
-
Style/RedundantAssignment:
|
31
|
-
Enabled: true
|
32
|
-
Style/RedundantFetchBlock:
|
33
|
-
Enabled: true
|
34
|
-
Style/RedundantRegexpCharacterClass:
|
35
|
-
Enabled: true
|
36
|
-
Style/RedundantRegexpEscape:
|
37
|
-
Enabled: true
|
38
|
-
Style/SlicingWithRange:
|
39
|
-
Enabled: true
|
40
|
-
|
41
|
-
# Disable this cop until this isssue gets a clear answer:
|
42
|
-
# https://github.com/rubocop/rubocop/issues/10675
|
43
|
-
Gemspec/DeprecatedAttributeAssignment:
|
44
|
-
Enabled: false
|
4
|
+
inherit_gem:
|
5
|
+
standard: config/base.yml
|
45
6
|
|
46
7
|
AllCops:
|
47
8
|
TargetRubyVersion: 3.0
|
48
|
-
Exclude:
|
49
|
-
- tmp/**/*
|
50
|
-
- "vendor/**/*"
|
51
|
-
# Generated binstubs
|
52
|
-
- bin/rake
|
53
|
-
NewCops: enable
|
54
|
-
|
55
|
-
Style/FrozenStringLiteralComment:
|
56
|
-
Exclude:
|
57
|
-
- "**/bin/*"
|
58
|
-
- "**/exe/*"
|
59
|
-
- "spec/**/*"
|
data/.standard.yml
ADDED
data/Gemfile
CHANGED
@@ -7,27 +7,27 @@ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
|
|
7
7
|
# Specify your gem's dependencies in solidus_dev_support.gemspec
|
8
8
|
gemspec
|
9
9
|
|
10
|
-
branch = ENV.fetch(
|
11
|
-
gem
|
10
|
+
branch = ENV.fetch("SOLIDUS_BRANCH", "main")
|
11
|
+
gem "solidus", github: "solidusio/solidus", branch: branch
|
12
12
|
|
13
13
|
rails_version = ENV.fetch("RAILS_VERSION", "7.0")
|
14
|
-
gem
|
14
|
+
gem "rails", "~> #{rails_version}"
|
15
15
|
|
16
|
-
gem
|
17
|
-
gem
|
16
|
+
gem "bundler"
|
17
|
+
gem "rake"
|
18
18
|
|
19
19
|
# These gems will be used by the temporary extensions generated by tests
|
20
20
|
group :test do
|
21
|
-
gem
|
22
|
-
gem
|
23
|
-
gem
|
24
|
-
gem
|
21
|
+
gem "mysql2"
|
22
|
+
gem "pg"
|
23
|
+
gem "solidus_auth_devise"
|
24
|
+
gem "sqlite3", (rails_version < "7.2") ? "~> 1.4" : "~> 2.0"
|
25
25
|
end
|
26
26
|
|
27
27
|
# Use a local Gemfile to include development dependencies that might not be
|
28
28
|
# relevant for the project or for other contributors, e.g.: `gem 'pry-debug'`.
|
29
|
-
eval_gemfile
|
29
|
+
eval_gemfile "Gemfile-local" if File.exist? "Gemfile-local"
|
30
30
|
|
31
31
|
if rails_version == "7.0"
|
32
|
-
gem
|
32
|
+
gem "concurrent-ruby", "< 1.3.5"
|
33
33
|
end
|
data/README.md
CHANGED
@@ -168,9 +168,7 @@ jobs:
|
|
168
168
|
### RuboCop configuration
|
169
169
|
|
170
170
|
solidus_dev_support includes a default [RuboCop](https://github.com/rubocop-hq/rubocop)
|
171
|
-
configuration for Solidus extensions.
|
172
|
-
[Relaxed Ruby Style](https://relaxed.ruby.style) with a few customizations, but in the future we
|
173
|
-
plan to provide custom cops to ensure your extension follows established Solidus best practices.
|
171
|
+
configuration for Solidus extensions. This configuration is based on the excellent [`standardrb`](https://github.com/standardrb/standard) gem.
|
174
172
|
|
175
173
|
We strongly recommend including the RuboCop configuration in your extension. All you have to do is
|
176
174
|
add this to your `.rubocop.yml`:
|
data/bin/setup
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
require
|
2
|
+
require "fileutils"
|
3
3
|
include FileUtils # rubocop:disable Style/MixinUsage
|
4
4
|
|
5
|
-
GEM_ROOT = File.expand_path(
|
5
|
+
GEM_ROOT = File.expand_path("..", __dir__)
|
6
6
|
|
7
7
|
def system(*args)
|
8
|
-
puts "$ #{args.size == 1 ? args.first : args.shelljoin}"
|
8
|
+
puts "$ #{(args.size == 1) ? args.first : args.shelljoin}"
|
9
9
|
super
|
10
10
|
end
|
11
11
|
|
@@ -16,5 +16,5 @@ end
|
|
16
16
|
cd GEM_ROOT
|
17
17
|
|
18
18
|
puts "\n== Installing Ruby dependencies =="
|
19
|
-
system! %
|
20
|
-
system! %
|
19
|
+
system! %(gem install bundler --conservative)
|
20
|
+
system! %(bundle check || bundle install)
|
data/bin/solidus
CHANGED
data/exe/solidus
CHANGED
@@ -1,47 +1,47 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
3
|
+
require "thor"
|
4
|
+
require "pathname"
|
5
5
|
|
6
|
-
require
|
6
|
+
require "solidus_dev_support/version"
|
7
7
|
|
8
8
|
module SolidusDevSupport
|
9
9
|
class Extension < Thor
|
10
10
|
include Thor::Actions
|
11
|
-
PREFIX =
|
11
|
+
PREFIX = "solidus_"
|
12
12
|
|
13
13
|
default_command :generate
|
14
14
|
|
15
|
-
desc
|
16
|
-
def generate(raw_path =
|
15
|
+
desc "generate PATH", "Generates a new Solidus extension"
|
16
|
+
def generate(raw_path = ".")
|
17
17
|
self.path = raw_path
|
18
18
|
|
19
19
|
empty_directory path
|
20
20
|
|
21
|
-
directory
|
22
|
-
directory
|
23
|
-
directory
|
24
|
-
directory
|
25
|
-
directory
|
21
|
+
directory "app", "#{path}/app"
|
22
|
+
directory "lib", "#{path}/lib"
|
23
|
+
directory "bin", "#{path}/bin"
|
24
|
+
directory ".circleci", "#{path}/.circleci"
|
25
|
+
directory ".github", "#{path}/.github"
|
26
26
|
|
27
27
|
Dir["#{path}/bin/*"].each do |bin|
|
28
28
|
make_executable bin
|
29
29
|
end
|
30
30
|
|
31
|
-
template
|
32
|
-
template
|
33
|
-
template
|
34
|
-
template
|
35
|
-
template
|
36
|
-
template
|
37
|
-
template
|
38
|
-
template
|
39
|
-
template
|
40
|
-
template
|
41
|
-
template
|
42
|
-
template
|
43
|
-
template
|
44
|
-
template
|
31
|
+
template "CHANGELOG.md", "#{path}/CHANGELOG.md"
|
32
|
+
template "extension.gemspec", "#{path}/#{file_name}.gemspec"
|
33
|
+
template "Gemfile", "#{path}/Gemfile"
|
34
|
+
template "gitignore", "#{path}/.gitignore"
|
35
|
+
template "gem_release.yml.tt", "#{path}/.gem_release.yml"
|
36
|
+
template "LICENSE", "#{path}/LICENSE"
|
37
|
+
template "Rakefile", "#{path}/Rakefile"
|
38
|
+
template "README.md", "#{path}/README.md"
|
39
|
+
template "config/routes.rb", "#{path}/config/routes.rb"
|
40
|
+
template "config/locales/en.yml", "#{path}/config/locales/en.yml"
|
41
|
+
template "rspec", "#{path}/.rspec"
|
42
|
+
template "spec/spec_helper.rb.tt", "#{path}/spec/spec_helper.rb"
|
43
|
+
template "rubocop.yml", "#{path}/.rubocop.yml"
|
44
|
+
template "github_changelog_generator", "#{path}/.github_changelog_generator"
|
45
45
|
end
|
46
46
|
|
47
47
|
no_tasks do
|
@@ -70,17 +70,17 @@ module SolidusDevSupport
|
|
70
70
|
end
|
71
71
|
|
72
72
|
def default_gemspec
|
73
|
-
@default_gemspec ||= Gem::Specification.new(file_name,
|
74
|
-
gem.author = git(
|
75
|
-
gem.email = git(
|
73
|
+
@default_gemspec ||= Gem::Specification.new(file_name, "0.0.1") do |gem|
|
74
|
+
gem.author = git("config user.name", "TODO: Write your name")
|
75
|
+
gem.email = git("config user.email", "TODO: Write your email address")
|
76
76
|
|
77
|
-
gem.summary =
|
78
|
-
gem.description =
|
79
|
-
gem.license =
|
77
|
+
gem.summary = "TODO: Write a short summary, because RubyGems requires one."
|
78
|
+
gem.description = "TODO: Write a longer description or delete this line."
|
79
|
+
gem.license = "BSD-3-Clause"
|
80
80
|
|
81
|
-
gem.metadata[
|
82
|
-
gem.metadata[
|
83
|
-
gem.metadata[
|
81
|
+
gem.metadata["homepage_uri"] = gem.homepage = "https://github.com/#{repo}#readme"
|
82
|
+
gem.metadata["changelog_uri"] = "https://github.com/#{repo}/blob/main/CHANGELOG.md"
|
83
|
+
gem.metadata["source_code_uri"] = "https://github.com/#{repo}"
|
84
84
|
end
|
85
85
|
end
|
86
86
|
|
@@ -95,9 +95,9 @@ module SolidusDevSupport
|
|
95
95
|
spec.license ||= default_gemspec.license
|
96
96
|
|
97
97
|
spec.homepage ||= default_gemspec.homepage
|
98
|
-
spec.metadata[
|
99
|
-
spec.metadata[
|
100
|
-
spec.metadata[
|
98
|
+
spec.metadata["source_code_uri"] ||= default_gemspec.metadata["source_code_uri"]
|
99
|
+
spec.metadata["changelog_uri"] ||= default_gemspec.metadata["changelog_uri"]
|
100
|
+
spec.metadata["source_code_uri"] ||= default_gemspec.metadata["source_code_uri"]
|
101
101
|
end
|
102
102
|
end
|
103
103
|
|
@@ -106,7 +106,7 @@ module SolidusDevSupport
|
|
106
106
|
end
|
107
107
|
|
108
108
|
def existing_repo
|
109
|
-
git(
|
109
|
+
git("remote get-url origin")&.sub(%r{^.*github\.com.([^/]+)/([^/.]+).*$}, '\1/\2')
|
110
110
|
end
|
111
111
|
|
112
112
|
def git(command, default = nil)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
3
|
+
require "rake"
|
4
|
+
require "pathname"
|
5
5
|
|
6
6
|
module SolidusDevSupport
|
7
7
|
class RakeTasks
|
@@ -13,7 +13,7 @@ module SolidusDevSupport
|
|
13
13
|
|
14
14
|
def initialize(root: Dir.pwd, user_class: "Spree::LegacyUser")
|
15
15
|
@root = Pathname(root)
|
16
|
-
@test_app_path = @root.join(ENV.fetch(
|
16
|
+
@test_app_path = @root.join(ENV.fetch("DUMMY_PATH", "spec/dummy"))
|
17
17
|
@gemspec = Bundler.load_gemspec(@root.glob("{,*}.gemspec").first)
|
18
18
|
@user_class = user_class
|
19
19
|
end
|
@@ -28,11 +28,11 @@ module SolidusDevSupport
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def install_test_app_task
|
31
|
-
require
|
32
|
-
require
|
31
|
+
require "rake/clean"
|
32
|
+
require "spree/testing_support/extension_rake"
|
33
33
|
|
34
|
-
ENV[
|
35
|
-
ENV[
|
34
|
+
ENV["DUMMY_PATH"] = test_app_path.to_s
|
35
|
+
ENV["LIB_NAME"] = gemspec.name
|
36
36
|
|
37
37
|
::CLOBBER.include test_app_path
|
38
38
|
|
@@ -40,12 +40,12 @@ module SolidusDevSupport
|
|
40
40
|
# We need to go back to the gem root since the upstream
|
41
41
|
# extension:test_app changes the working directory to be the dummy app.
|
42
42
|
task :test_app do
|
43
|
-
Rake::Task[
|
43
|
+
Rake::Task["extension:test_app"].invoke(@user_class)
|
44
44
|
cd root
|
45
45
|
end
|
46
46
|
|
47
|
-
directory ENV.fetch(
|
48
|
-
Rake::Task[
|
47
|
+
directory ENV.fetch("DUMMY_PATH", nil) do
|
48
|
+
Rake::Task["extension:test_app"].invoke(@user_class)
|
49
49
|
end
|
50
50
|
end
|
51
51
|
end
|
@@ -59,31 +59,31 @@ module SolidusDevSupport
|
|
59
59
|
end
|
60
60
|
|
61
61
|
def install_rspec_task
|
62
|
-
require
|
62
|
+
require "rspec/core/rake_task"
|
63
63
|
|
64
64
|
namespace :extension do
|
65
|
-
::RSpec::Core::RakeTask.new(:specs, [] => FileList[ENV.fetch(
|
65
|
+
::RSpec::Core::RakeTask.new(:specs, [] => FileList[ENV.fetch("DUMMY_PATH", nil)]) do |t|
|
66
66
|
# Ref: https://circleci.com/docs/2.0/configuration-reference#store_test_results
|
67
67
|
# Ref: https://github.com/solidusio/circleci-orbs-extensions#test-results-rspec
|
68
|
-
if ENV[
|
68
|
+
if ENV["TEST_RESULTS_PATH"]
|
69
69
|
t.rspec_opts =
|
70
70
|
"--format progress " \
|
71
|
-
"--format RspecJunitFormatter --out #{ENV[
|
71
|
+
"--format RspecJunitFormatter --out #{ENV["TEST_RESULTS_PATH"]}"
|
72
72
|
end
|
73
73
|
end
|
74
74
|
end
|
75
75
|
end
|
76
76
|
|
77
77
|
def install_changelog_task
|
78
|
-
require
|
78
|
+
require "github_changelog_generator/task"
|
79
79
|
|
80
80
|
GitHubChangelogGenerator::RakeTask.new(:changelog) do |config|
|
81
|
-
require
|
82
|
-
repo = Octokit::Repository.from_url(gemspec.metadata[
|
81
|
+
require "octokit"
|
82
|
+
repo = Octokit::Repository.from_url(gemspec.metadata["source_code_uri"] || gemspec.homepage)
|
83
83
|
|
84
84
|
config.user = repo.owner
|
85
85
|
config.project = repo.name
|
86
|
-
config.future_release = "v#{ENV.fetch(
|
86
|
+
config.future_release = "v#{ENV.fetch("UNRELEASED_VERSION") { gemspec.version }}"
|
87
87
|
rescue Octokit::InvalidRepository
|
88
88
|
warn <<~WARN
|
89
89
|
It won't be possible to automatically generate the CHANGELOG for this extension because the
|
@@ -1,13 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# Allow to override the initial windows size
|
4
|
-
CAPYBARA_WINDOW_SIZE = ENV.fetch(
|
4
|
+
CAPYBARA_WINDOW_SIZE = ENV.fetch("CAPYBARA_WINDOW_SIZE", "1920x1080").split("x", 2).map(&:to_i)
|
5
5
|
CAPYBARA_WINDOW_WIDTH = CAPYBARA_WINDOW_SIZE[0]
|
6
6
|
CAPYBARA_WINDOW_HEIGHT = CAPYBARA_WINDOW_SIZE[1]
|
7
7
|
|
8
|
-
Capybara.javascript_driver = ENV.fetch(
|
8
|
+
Capybara.javascript_driver = ENV.fetch("CAPYBARA_JAVASCRIPT_DRIVER", "solidus_chrome_headless").to_sym
|
9
9
|
Capybara.default_max_wait_time = 10
|
10
|
-
Capybara.server = :puma, {
|
10
|
+
Capybara.server = :puma, {Silent: true} # A fix for rspec/rspec-rails#1897
|
11
11
|
|
12
12
|
Capybara.drivers[:selenium_chrome_headless].tap do |original_driver|
|
13
13
|
Capybara.register_driver :solidus_chrome_headless do |app|
|
@@ -19,10 +19,10 @@ Capybara.drivers[:selenium_chrome_headless].tap do |original_driver|
|
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
22
|
-
require
|
22
|
+
require "capybara-screenshot/rspec"
|
23
23
|
|
24
24
|
Capybara::Screenshot.register_driver(:solidus_chrome_headless) do |driver, path|
|
25
25
|
driver.browser.save_screenshot(path)
|
26
26
|
end
|
27
27
|
|
28
|
-
require
|
28
|
+
require "spree/testing_support/capybara_ext"
|
@@ -9,23 +9,23 @@
|
|
9
9
|
# Note that things may not work properly if you don't include this at the very top!
|
10
10
|
#
|
11
11
|
|
12
|
-
require
|
13
|
-
SimpleCov.start(
|
12
|
+
require "simplecov"
|
13
|
+
SimpleCov.start("rails") do
|
14
14
|
add_filter %r{^/lib/generators/.*/install/install_generator.rb}
|
15
15
|
add_filter %r{^/lib/.*/factories.rb}
|
16
16
|
add_filter %r{^/lib/.*/version.rb}
|
17
17
|
end
|
18
18
|
|
19
|
-
if ENV[
|
20
|
-
require
|
19
|
+
if ENV["CODECOV_TOKEN"]
|
20
|
+
require "codecov"
|
21
21
|
SimpleCov.formatter = SimpleCov::Formatter::Codecov
|
22
22
|
warn <<~WARN
|
23
23
|
DEPRECATION WARNING: The Codecov ruby uploader is deprecated.
|
24
24
|
Please use the Codecov CLI uploader to upload code coverage reports.
|
25
25
|
See https://docs.codecov.com/docs/deprecated-uploader-migration-guide#ruby-uploader for more information on upgrading.
|
26
26
|
WARN
|
27
|
-
elsif ENV[
|
28
|
-
require
|
27
|
+
elsif ENV["CODECOV_COVERAGE_PATH"]
|
28
|
+
require "simplecov-cobertura"
|
29
29
|
SimpleCov.formatter = SimpleCov::Formatter::CoberturaFormatter
|
30
30
|
else
|
31
31
|
warn "Provide a CODECOV_COVERAGE_PATH environment variable to enable Codecov uploads"
|
@@ -7,8 +7,8 @@
|
|
7
7
|
# require 'solidus_dev_support/rspec/feature_helper'
|
8
8
|
#
|
9
9
|
|
10
|
-
require
|
11
|
-
require
|
10
|
+
require "solidus_dev_support/rspec/rails_helper"
|
11
|
+
require "solidus_dev_support/rspec/capybara"
|
12
12
|
|
13
13
|
dev_support_assets_preload = ->(*) {
|
14
14
|
if Rails.application.respond_to?(:precompiled_assets)
|
@@ -7,20 +7,20 @@
|
|
7
7
|
# require 'solidus_dev_support/rspec/rails_helper'
|
8
8
|
#
|
9
9
|
|
10
|
-
require
|
11
|
-
require
|
10
|
+
require "solidus_dev_support/rspec/spec_helper"
|
11
|
+
require "solidus_dev_support"
|
12
12
|
|
13
|
-
require
|
14
|
-
require
|
15
|
-
require
|
16
|
-
require
|
13
|
+
require "rspec/rails"
|
14
|
+
require "database_cleaner"
|
15
|
+
require "factory_bot"
|
16
|
+
require "ffaker"
|
17
17
|
|
18
|
-
require
|
19
|
-
require
|
20
|
-
require
|
21
|
-
require
|
22
|
-
require
|
23
|
-
require
|
18
|
+
require "spree/testing_support/authorization_helpers"
|
19
|
+
require "spree/testing_support/url_helpers"
|
20
|
+
require "spree/testing_support/preferences"
|
21
|
+
require "spree/testing_support/controller_requests"
|
22
|
+
require "solidus_dev_support/testing_support/factories"
|
23
|
+
require "solidus_dev_support/testing_support/preferences"
|
24
24
|
|
25
25
|
RSpec.configure do |config|
|
26
26
|
config.infer_spec_type_from_file_location!
|
@@ -66,8 +66,8 @@ RSpec.configure do |config|
|
|
66
66
|
class ZeitwerkNameError < NameError; end
|
67
67
|
|
68
68
|
error_message =
|
69
|
-
if
|
70
|
-
e.message.sub(/expected file #{Regexp.escape(File.expand_path(
|
69
|
+
if /expected file .*? to define constant [\w:]+/.match?(e.message)
|
70
|
+
e.message.sub(/expected file #{Regexp.escape(File.expand_path("../..", Rails.root))}./, "expected file ")
|
71
71
|
else
|
72
72
|
e.message
|
73
73
|
end
|
@@ -14,8 +14,8 @@ RSpec.configure do |config|
|
|
14
14
|
config.mock_with :rspec
|
15
15
|
config.color = true
|
16
16
|
|
17
|
-
config.fail_fast = ENV.fetch(
|
18
|
-
config.order =
|
17
|
+
config.fail_fast = ENV.fetch("FAIL_FAST", false)
|
18
|
+
config.order = "random"
|
19
19
|
|
20
20
|
config.raise_errors_for_deprecations!
|
21
21
|
|
@@ -1,82 +1,13 @@
|
|
1
|
-
require:
|
1
|
+
require:
|
2
|
+
- standard
|
2
3
|
|
3
|
-
|
4
|
+
inherit_gem:
|
5
|
+
standard: config/base.yml
|
4
6
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
Layout/SpaceAroundMethodCallOperator: {Enabled: true}
|
13
|
-
Layout/SpaceBeforeBlockBraces: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#layoutspacebeforeblockbraces"}
|
14
|
-
Layout/SpaceInsideParens: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#layoutspaceinsideparens"}
|
15
|
-
Lint/AmbiguousRegexpLiteral: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#lintambiguousregexpliteral"}
|
16
|
-
Lint/AssignmentInCondition: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#lintassignmentincondition"}
|
17
|
-
Lint/DeprecatedOpenSSLConstant: {Enabled: true}
|
18
|
-
Lint/MixedRegexpCaptureTypes: {Enabled: true}
|
19
|
-
Lint/RaiseException: {Enabled: true}
|
20
|
-
Lint/StructNewOverride: {Enabled: true}
|
21
|
-
Metrics/AbcSize: {Enabled: false}
|
22
|
-
Metrics/BlockLength: {Enabled: false}
|
23
|
-
Metrics/BlockNesting: {Enabled: false}
|
24
|
-
Metrics/ClassLength: {Enabled: false}
|
25
|
-
Metrics/CyclomaticComplexity: {Enabled: false}
|
26
|
-
Metrics/MethodLength: {Enabled: false}
|
27
|
-
Metrics/ModuleLength: {Enabled: false}
|
28
|
-
Metrics/ParameterLists: {Enabled: false}
|
29
|
-
Metrics/PerceivedComplexity: {Enabled: false}
|
30
|
-
Performance/AncestorsInclude: {Enabled: true}
|
31
|
-
Performance/BigDecimalWithNumericArgument: {Enabled: true}
|
32
|
-
Performance/RedundantSortBlock: {Enabled: true}
|
33
|
-
Performance/RedundantStringChars: {Enabled: true}
|
34
|
-
Performance/ReverseFirst: {Enabled: true}
|
35
|
-
Performance/SortReverse: {Enabled: true}
|
36
|
-
Performance/Squeeze: {Enabled: true}
|
37
|
-
Performance/StringInclude: {Enabled: true}
|
38
|
-
RSpec/DescribeClass: {Exclude: ["spec/features/**/*"]} # Feature specs are not describing any class or module.
|
39
|
-
RSpec/ExampleLength: {Enabled: false}
|
40
|
-
Style/AccessorGrouping: {Enabled: true}
|
41
|
-
Style/Alias: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#stylealias"}
|
42
|
-
Style/AsciiComments: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#styleasciicomments"}
|
43
|
-
Style/BeginBlock: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#stylebeginblock"}
|
44
|
-
Style/BisectedAttrAccessor: {Enabled: true}
|
45
|
-
Style/BlockDelimiters: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#styleblockdelimiters"}
|
46
|
-
Style/CommentAnnotation: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#stylecommentannotation"}
|
47
|
-
Style/Documentation: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#styledocumentation"}
|
48
|
-
Style/DoubleNegation: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#styledoublenegation"}
|
49
|
-
Style/EndBlock: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#styleendblock"}
|
50
|
-
Style/ExponentialNotation: {Enabled: true}
|
51
|
-
Style/FormatString: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#styleformatstring"}
|
52
|
-
Style/FrozenStringLiteralComment: {Exclude: ["spec/**/*", "db/migrate/**/*", "bin/**/*"]}
|
53
|
-
Style/HashEachMethods: {Enabled: true}
|
54
|
-
Style/HashTransformKeys: {Enabled: true}
|
55
|
-
Style/HashTransformValues: {Enabled: true}
|
56
|
-
Style/IfUnlessModifier: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#styleifunlessmodifier"}
|
57
|
-
Style/Lambda: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#stylelambda"}
|
58
|
-
Style/ModuleFunction: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#stylemodulefunction"}
|
59
|
-
Style/MultilineBlockChain: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#stylemultilineblockchain"}
|
60
|
-
Style/NegatedIf: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#stylenegatedif"}
|
61
|
-
Style/NegatedWhile: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#stylenegatedwhile"}
|
62
|
-
Style/NumericPredicate: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#stylenumericpredicate"}
|
63
|
-
Style/ParallelAssignment: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#styleparallelassignment"}
|
64
|
-
Style/PercentLiteralDelimiters: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#stylepercentliteraldelimiters"}
|
65
|
-
Style/PerlBackrefs: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#styleperlbackrefs"}
|
66
|
-
Style/RedundantAssignment: {Enabled: true}
|
67
|
-
Style/RedundantFetchBlock: {Enabled: true}
|
68
|
-
Style/RedundantRegexpCharacterClass: {Enabled: true}
|
69
|
-
Style/RedundantRegexpEscape: {Enabled: true}
|
70
|
-
Style/Semicolon: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#stylesemicolon"}
|
71
|
-
Style/SignalException: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#stylesignalexception"}
|
72
|
-
Style/SingleLineBlockParams: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#stylesinglelineblockparams"}
|
73
|
-
Style/SingleLineMethods: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#stylesinglelinemethods"}
|
74
|
-
Style/SlicingWithRange: {Enabled: true}
|
75
|
-
Style/SpecialGlobalVars: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#stylespecialglobalvars"}
|
76
|
-
Style/StringLiterals: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#stylestringliterals"}
|
77
|
-
Style/SymbolArray: {Enabled: false, StyleGuide: "http://relaxed.ruby.style/#stylesymbolarray"}
|
78
|
-
Style/TrailingCommaInArguments: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#styletrailingcommainarguments"}
|
79
|
-
Style/TrailingCommaInArrayLiteral: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#styletrailingcommainarrayliteral"}
|
80
|
-
Style/TrailingCommaInHashLiteral: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#styletrailingcommainhashliteral"}
|
81
|
-
Style/WhileUntilModifier: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#stylewhileuntilmodifier"}
|
82
|
-
Style/WordArray: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#stylewordarray"}
|
7
|
+
AllCops:
|
8
|
+
TargetRubyVersion: 3.0
|
9
|
+
Exclude:
|
10
|
+
- spec/dummy/**/*
|
11
|
+
- sandbox/**/*
|
12
|
+
- vendor/**/*
|
13
|
+
- bin/*
|