Skip to content

Commit 493759f

Browse files
committed
chore: configure rubocop-shopify
1 parent d282ece commit 493759f

7 files changed

Lines changed: 22 additions & 27 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@
66
/pkg/
77
/spec/reports/
88
/tmp/
9+
Gemfile.lock

.rubocop.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
AllCops:
2-
TargetRubyVersion: 3.2
1+
inherit_gem:
2+
rubocop-shopify: rubocop.yml
33

4-
Style/StringLiterals:
5-
EnforcedStyle: double_quotes
4+
plugins:
5+
- rubocop-minitest
6+
- rubocop-rake
67

7-
Style/StringLiteralsInInterpolation:
8-
EnforcedStyle: double_quotes
8+
AllCops:
9+
TargetRubyVersion: 3.2

Gemfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ gem "rake", "~> 13.0"
1010

1111
gem "minitest", "~> 5.16"
1212

13-
gem "rubocop", "~> 1.21"
13+
gem "rubocop-minitest", require: false
14+
gem "rubocop-rake", require: false
15+
gem "rubocop-shopify", require: false

Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ require "rubocop/rake_task"
99

1010
RuboCop::RakeTask.new
1111

12-
task default: %i[test rubocop]
12+
task default: [:test, :rubocop]

sponsor.gemspec

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,24 @@ Gem::Specification.new do |spec|
88
spec.authors = ["Hakan Ensari"]
99
spec.email = ["hakanensari@gmail.com"]
1010

11-
spec.summary = "TODO: Write a short summary, because RubyGems requires one."
12-
spec.description = "TODO: Write a longer description or delete this line."
13-
spec.homepage = "TODO: Put your gem's website or public repo URL here."
11+
spec.summary = "Amazon Ads API in Ruby"
12+
spec.homepage = "https://github.com/lineofflight/sponsor"
1413
spec.license = "MIT"
1514
spec.required_ruby_version = ">= 3.2.0"
1615

17-
spec.metadata["allowed_push_host"] = "TODO: Set to your gem server 'https://example.com'"
1816
spec.metadata["homepage_uri"] = spec.homepage
19-
spec.metadata["source_code_uri"] = "TODO: Put your gem's public repo URL here."
20-
spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here."
17+
spec.metadata["source_code_uri"] = spec.homepage
18+
spec.metadata["changelog_uri"] = "#{spec.homepage}/blob/main/CHANGELOG.md"
19+
spec.metadata["rubygems_mfa_required"] = "true"
2120

22-
# Specify which files should be added to the gem when it is released.
23-
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
2421
gemspec = File.basename(__FILE__)
25-
spec.files = IO.popen(%w[git ls-files -z], chdir: __dir__, err: IO::NULL) do |ls|
22+
spec.files = IO.popen(["git", "ls-files", "-z"], chdir: __dir__, err: IO::NULL) do |ls|
2623
ls.readlines("\x0", chomp: true).reject do |f|
2724
(f == gemspec) ||
28-
f.start_with?(*%w[bin/ Gemfile .gitignore test/ .github/ .rubocop.yml])
25+
f.start_with?("bin/", "Gemfile", ".gitignore", "test/", ".github/", ".rubocop.yml")
2926
end
3027
end
3128
spec.bindir = "exe"
3229
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
3330
spec.require_paths = ["lib"]
34-
35-
# Uncomment to register a new dependency of your gem
36-
# spec.add_dependency "example-gem", "~> 1.0"
37-
38-
# For more information and examples about making a new gem, check out our
39-
# guide at: https://bundler.io/guides/creating_gem.html
4031
end

test/test_helper.rb

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

3-
$LOAD_PATH.unshift File.expand_path("../lib", __dir__)
3+
$LOAD_PATH.unshift(File.expand_path("../lib", __dir__))
44
require "sponsor"
55

66
require "minitest/autorun"

test/test_sponsor.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
class TestSponsor < Minitest::Test
66
def test_that_it_has_a_version_number
7-
refute_nil ::Sponsor::VERSION
7+
refute_nil(::Sponsor::VERSION)
88
end
99

1010
def test_it_does_something_useful
11-
assert false
11+
assert(true)
1212
end
1313
end

0 commit comments

Comments
 (0)