rubocop-solidus 0.1.1 → 0.1.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 101df3597b1ea7fe8229ada4f77a940a7918edb988025a5dc59422d459985410
4
- data.tar.gz: 322ae6772c8d8c05e71cb3e5d257da7cf1970dea04d4dc1394e7d094fc9fcf61
3
+ metadata.gz: 745ca1ca12310bb9de934135f03aae227d87d616005ce5e82aafe58d6554a88d
4
+ data.tar.gz: 9723caf52452c8b1d4fa8bf88f644298bda3d01631af85df95a6aceb6b741462
5
5
  SHA512:
6
- metadata.gz: 52e20d00967742080012fc3a09ceac7a847b792fe6bc510f9caca95ccaef4de6993e203344b1d16157a34f4814aaeb165386718cba3701cd5d4d1a6ef2af035c
7
- data.tar.gz: e384e8d9eaae46bd4d9027c3ba46b3829b9ab4f4d7a56714666fb85e8d53665a5dbcbd872c7e0719e4ac8387d86d8bad4a09b4481c1465b0bf5c3fe6c5e4a65b
6
+ metadata.gz: 8683bf3a98d2483a25e1d18a078ca9a44ad39eb138a069364b664dbdc989f0199a7bcb86c68ce750268a310ca0c0342cc4cd55a60448edc65d3ff9b3a28e56f8
7
+ data.tar.gz: 2c36b5f8362baf576f3eaecc05e63324d988f1fcf0a0d63ce27c606787437a8fd303e8ca1172269f7766de26378d6aaf2598831dcbf43eef5583551f2581177a
data/.rubocop.yml CHANGED
@@ -1,6 +1,7 @@
1
+ inherit_from: .rubocop_todo.yml
2
+
1
3
  AllCops:
2
4
  NewCops: enable
3
- TargetRubyVersion: 2.4
4
5
 
5
6
  Naming/FileName:
6
7
  Exclude:
@@ -16,8 +17,3 @@ Metrics/BlockLength:
16
17
  Metrics/ClassLength:
17
18
  Exclude:
18
19
  - 'tasks/**/*.rb'
19
-
20
- # Prevents Ruby 3.1 incompatibility error. You can enable this cop when Ruby 2.4 support is dropped.
21
- # See https://github.com/rubocop/rubocop/issues/10258
22
- Layout/BlockAlignment:
23
- Enabled: false
data/.rubocop_todo.yml ADDED
@@ -0,0 +1,15 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2023-07-21 15:08:23 UTC using RuboCop version 1.54.2.
4
+ # The point is for the user to remove these configuration records
5
+ # one by one as the offenses are removed from the code base.
6
+ # Note that changes in the inspected code, or installation of new
7
+ # versions of RuboCop, may require this file to be generated again.
8
+
9
+ # Offense count: 1
10
+ # This cop supports safe autocorrection (--autocorrect).
11
+ # Configuration parameters: Severity, Include.
12
+ # Include: **/*.gemspec
13
+ Gemspec/RequireMFA:
14
+ Exclude:
15
+ - 'rubocop-solidus.gemspec'
data/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  ## master (unreleased)
2
2
 
3
+ ## 0.1.3 (2023-07-28)
4
+
5
+ ### New features
6
+
7
+ * [#47](https://github.com/solidusio/rubocop-solidus/pull/47): Remove support for old versions of ruby. ([@MassimilianoLattanzio][])
8
+
9
+ ### Bug fixes
10
+
11
+ * [#48](https://github.com/solidusio/rubocop-solidus/pull/48): Fix typos in README and add instructions on how to use the changelog rake task. ([@MassimilianoLattanzio][])
12
+
13
+ ## 0.1.2 (2023-07-14)
14
+
15
+ ### New features
16
+
17
+ * [#45](https://github.com/solidusio/rubocop-solidus/pull/45): Fix gem version comparison. ([@MassimilianoLattanzio][])
18
+
3
19
  ## 0.1.0 (2023-07-10)
4
20
 
5
21
  - Initial release
22
+ [@MassimilianoLattanzio]: https://github.com/MassimilianoLattanzio
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rubocop-solidus (0.1.1)
4
+ rubocop-solidus (0.1.3)
5
5
  rubocop
6
6
 
7
7
  GEM
@@ -11,15 +11,17 @@ GEM
11
11
  bump (0.10.0)
12
12
  coderay (1.1.3)
13
13
  diff-lcs (1.5.0)
14
+ json (2.6.3)
15
+ language_server-protocol (3.17.0.3)
14
16
  method_source (1.0.0)
15
- parallel (1.20.1)
17
+ parallel (1.23.0)
16
18
  parser (3.2.2.3)
17
19
  ast (~> 2.4.1)
18
20
  racc
19
21
  pry (0.14.2)
20
22
  coderay (~> 1.1)
21
23
  method_source (~> 1.0)
22
- racc (1.5.2)
24
+ racc (1.7.1)
23
25
  rainbow (3.1.1)
24
26
  rake (13.0.6)
25
27
  regexp_parser (2.8.1)
@@ -37,17 +39,19 @@ GEM
37
39
  diff-lcs (>= 1.2.0, < 2.0)
38
40
  rspec-support (~> 3.12.0)
39
41
  rspec-support (3.12.1)
40
- rubocop (1.12.1)
42
+ rubocop (1.54.2)
43
+ json (~> 2.3)
44
+ language_server-protocol (>= 3.17.0)
41
45
  parallel (~> 1.10)
42
- parser (>= 3.0.0.0)
46
+ parser (>= 3.2.2.3)
43
47
  rainbow (>= 2.2.2, < 4.0)
44
48
  regexp_parser (>= 1.8, < 3.0)
45
- rexml
46
- rubocop-ast (>= 1.2.0, < 2.0)
49
+ rexml (>= 3.2.5, < 4.0)
50
+ rubocop-ast (>= 1.28.0, < 2.0)
47
51
  ruby-progressbar (~> 1.7)
48
- unicode-display_width (>= 1.4.0, < 3.0)
49
- rubocop-ast (1.4.1)
50
- parser (>= 2.7.1.5)
52
+ unicode-display_width (>= 2.4.0, < 3.0)
53
+ rubocop-ast (1.29.0)
54
+ parser (>= 3.2.1.0)
51
55
  ruby-progressbar (1.13.0)
52
56
  unicode-display_width (2.4.2)
53
57
 
data/README.md CHANGED
@@ -8,7 +8,7 @@ A RuboCop extension focused on enforcing Solidus best practices and coding conve
8
8
  Add this line to your application's Gemfile:
9
9
 
10
10
  ```ruby
11
- gem 'rubocop-solidus', github: 'nebulab/rubocop-solidus', require: false
11
+ gem 'rubocop-solidus' require: false
12
12
  ```
13
13
 
14
14
  And then execute:
@@ -35,17 +35,45 @@ After this simply use the `rubocop` command to start linting.
35
35
  To create a new cop, run the following command:
36
36
 
37
37
  ```bash
38
- $ bundle exec rake new_cop[Solidus/NameOfTheCop]
38
+ $ bundle exec rake 'new_cop[Solidus/NameOfTheCop]'
39
39
  ```
40
40
 
41
41
  and then follow the instructions on the screen.
42
42
 
43
+ ## Creating changelog entries
44
+
45
+ Changelog entries are just files under the `changelog/` folder that will be merged
46
+ into `CHANGELOG.md` at release time. You can create new changelog entries like this:
47
+
48
+ ```console
49
+ $ bundle exec rake changelog:new|fix|change
50
+ ```
51
+
52
+ The type of the changelog correspond to "new feature", "bug-fix" and "changed" entries in the changelog.
53
+
54
+ ### Changelog entry format
55
+
56
+ Here are a few examples:
57
+
58
+ ```markdown
59
+ * [#46](https://github.com/solidusio/rubocop-solidus/issues/46): **(Breaking)** Remove support for old Ruby versions. ([@MassimilianoLattanzio][])
60
+ * [#4](https://github.com/solidusio/rubocop-solidus/pull/4): Update CHANGELOG. ([@piyushswain][])
61
+ ```
62
+
63
+ * Create one file `changelog/{type}_{some_description}.md`, where `type` is `new` (New feature), `fix` or `change`, and `some_description` is unique to avoid conflicts. Task `changelog:fix` (or `:new` or `:change`) can help you.
64
+ * Mark it up in [Markdown syntax][1].
65
+ * The entry should be a single line, starting with `* ` (an asterisk and a space).
66
+ * If the change has a related GitHub issue (e.g. a bug fix for a reported issue), put a link to the issue as `[#123](https://github.com/solidusio/rubocop-solidus/issues/123): `.
67
+ * Describe the brief of the change. The sentence should end with a punctuation.
68
+ * If this is a breaking change, mark it with `**(Breaking)**`.
69
+ * At the end of the entry, add an implicit link to your GitHub user page as `([@username][])`.
70
+
43
71
  ## Release a new version
44
72
 
45
73
  To release a new version, run the following command:
46
74
 
47
75
  ```bash
48
- $ bundle exec rake cut_release:[major|minor|patch]
76
+ $ bundle exec rake cut_release:major|minor|patch
49
77
  ```
50
78
 
51
79
  and then follow the instructions on the screen.
@@ -63,8 +91,10 @@ $ bundle exec rake release
63
91
 
64
92
  ## Contributing
65
93
 
66
- Bug reports and pull requests are welcome on GitHub at https://github.com/nebulab/rubocop-solidus.
94
+ Bug reports and pull requests are welcome on GitHub at https://github.com/solidusio/rubocop-solidus.
67
95
 
68
96
  ## License
69
97
 
70
98
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
99
+
100
+ [1]: https://www.markdownguide.org/basic-syntax/
data/config/default.yml CHANGED
@@ -12,58 +12,58 @@ Solidus/ClassEvalDecorator:
12
12
  Description: 'Checks if Class.class_eval is being used in the code'
13
13
  Enabled: true
14
14
  VersionAdded: '0.1.0'
15
- Reference: 'https://github.com/nebulab/rubocop-solidus/issues/21'
15
+ Reference: 'https://github.com/solidusio/rubocop-solidus/issues/21'
16
16
 
17
17
  Solidus/ReimbursementHookDeprecated:
18
18
  Description: 'Checks if reimbursement_success_hooks and reimbursement_failed_hooks is being used'
19
19
  Enabled: true
20
20
  VersionAdded: '0.1.0'
21
- Reference: 'https://github.com/nebulab/rubocop-solidus/issues/27'
21
+ Reference: 'https://github.com/solidusio/rubocop-solidus/issues/27'
22
22
 
23
23
  Solidus/SpreeCalculatorFreeShippingDeprecated:
24
24
  Description: 'Checks if Spree::Calculator::FreeShipping is being used and add deprecation message'
25
25
  Enabled: true
26
26
  VersionAdded: '0.1.0'
27
- Reference: 'https://github.com/nebulab/rubocop-solidus/issues/29'
27
+ Reference: 'https://github.com/solidusio/rubocop-solidus/issues/29'
28
28
 
29
29
  Solidus/SpreeCalculatorPercentPerItemDeprecated:
30
30
  Description: 'Checks if Spree::Calculator::PercentPerItem is being used and add deprecation message'
31
31
  Enabled: true
32
32
  VersionAdded: '0.1.0'
33
- Reference: 'https://github.com/nebulab/rubocop-solidus/issues/29'
33
+ Reference: 'https://github.com/solidusio/rubocop-solidus/issues/29'
34
34
 
35
35
  Solidus/SpreeCalculatorPriceSackDeprecated:
36
36
  Description: 'Checks if Spree::Calculator::PriceSack is being used and add deprecation message'
37
37
  Enabled: true
38
38
  VersionAdded: '0.1.0'
39
- Reference: 'https://github.com/nebulab/rubocop-solidus/issues/29'
39
+ Reference: 'https://github.com/solidusio/rubocop-solidus/issues/29'
40
40
 
41
41
  Solidus/SpreeDefaultCreditCardDeprecated:
42
42
  Description: 'Checks if user.default_credit_card is used and suggest using user.wallet.default_wallet_payment_source'
43
43
  Enabled: true
44
44
  VersionAdded: '0.1.0'
45
- Reference: 'https://github.com/nebulab/rubocop-solidus/issues/33'
45
+ Reference: 'https://github.com/solidusio/rubocop-solidus/issues/33'
46
46
 
47
47
  Solidus/SpreeGatewayBogusDeprecated:
48
48
  Description: 'Checks if SpreeGatewayBogus is being used and replaces it with Spree::PaymentMethod::BogusCreditCard'
49
49
  Enabled: true
50
50
  VersionAdded: '0.1.0'
51
- Reference: 'https://github.com/nebulab/rubocop-solidus/issues/26'
51
+ Reference: 'https://github.com/solidusio/rubocop-solidus/issues/26'
52
52
 
53
53
  Solidus/SpreeIconDeprecated:
54
54
  Description: 'Checks if icon helper is being used and suggest `solidus_icon`'
55
55
  Enabled: true
56
56
  VersionAdded: '0.1.0'
57
- Reference: 'https://github.com/nebulab/rubocop-solidus/issues/32'
57
+ Reference: 'https://github.com/solidusio/rubocop-solidus/issues/32'
58
58
 
59
59
  Solidus/SpreeRefundCallPerform:
60
60
  Description: 'Checks if Spree::Refund.create is being used and require calling .perform!'
61
61
  Enabled: true
62
62
  VersionAdded: '0.1.0'
63
- Reference: 'https://github.com/nebulab/rubocop-solidus/issues/28'
63
+ Reference: 'https://github.com/solidusio/rubocop-solidus/issues/28'
64
64
 
65
65
  Solidus/SpreeTDeprecated:
66
66
  Description: 'Checks if Spree.t is being used and replaces it with I18n.t.'
67
67
  Enabled: true
68
68
  VersionAdded: '0.1.0'
69
- Reference: 'https://github.com/nebulab/rubocop-solidus/issues/22'
69
+ Reference: 'https://github.com/solidusio/rubocop-solidus/issues/22'
@@ -22,7 +22,7 @@ module RuboCop
22
22
  end
23
23
 
24
24
  def targeted_solidus_version?(version)
25
- @minimum_solidus_version <= version
25
+ Gem::Version.new(@minimum_solidus_version) <= Gem::Version.new(version)
26
26
  end
27
27
  end
28
28
 
@@ -47,7 +47,7 @@ module RuboCop
47
47
 
48
48
  def target_solidus_version
49
49
  @target_solidus_version ||=
50
- config.for_all_cops['TargetSolidusVersion']&.to_f || solidus_version_from_lock_file || DEFAULT_SOLIDUS_VERSION
50
+ config.for_all_cops['TargetSolidusVersion'] || solidus_version_from_lock_file || DEFAULT_SOLIDUS_VERSION
51
51
  end
52
52
 
53
53
  def solidus_version_from_lock_file
@@ -62,7 +62,7 @@ module RuboCop
62
62
  # If Solidus (or one of its frameworks) is in Gemfile.lock, there should be a line like:
63
63
  # solidus_core (X.X.X)
64
64
  result = line.match(/^\s+solidus_core\s+\((\d+\.\d+)/)
65
- return result.captures.first.to_f if result
65
+ return result.captures.first if result
66
66
  end
67
67
  end
68
68
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RuboCop
4
4
  module Solidus
5
- VERSION = '0.1.1'
5
+ VERSION = '0.1.3'
6
6
  end
7
7
  end
@@ -0,0 +1,5 @@
1
+ ### New features
2
+
3
+ * [#45](https://github.com/solidusio/rubocop-solidus/pull/45): Fix gem version comparison. ([@MassimilianoLattanzio][])
4
+
5
+ [@MassimilianoLattanzio]: https://github.com/MassimilianoLattanzio
@@ -0,0 +1,9 @@
1
+ ### New features
2
+
3
+ * [#47](https://github.com/solidusio/rubocop-solidus/pull/47): Remove support for old versions of ruby. ([@MassimilianoLattanzio][])
4
+
5
+ ### Bug fixes
6
+
7
+ * [#48](https://github.com/solidusio/rubocop-solidus/pull/48): Fix typos in README and add instructions on how to use the changelog rake task. ([@MassimilianoLattanzio][])
8
+
9
+ [@MassimilianoLattanzio]: https://github.com/MassimilianoLattanzio
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'lib/rubocop/solidus/version'
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = 'rubocop-solidus'
7
+ spec.version = RuboCop::Solidus::VERSION
8
+ spec.authors = ['piyushswain']
9
+ spec.email = ['piyush.swain3@gmail.com']
10
+
11
+ spec.summary = 'Automatic Solidus code style checking tool.'
12
+ spec.description = <<~DESCRIPTION
13
+ Automatic Solidus code style checking tool.
14
+ A RuboCop extension focused on enforcing Solidus best practices and coding conventions.
15
+ DESCRIPTION
16
+ spec.homepage = 'https://www.github.com/solidusio/rubocop-solidus'
17
+ spec.license = 'MIT'
18
+ spec.required_ruby_version = '>= 2.7.0'
19
+
20
+ spec.metadata['homepage_uri'] = spec.homepage
21
+ spec.metadata['source_code_uri'] = 'https://www.github.com/solidusio/rubocop-solidus'
22
+ spec.metadata['changelog_uri'] = 'https://www.github.com/solidusio/rubocop-solidus'
23
+
24
+ # Specify which files should be added to the gem when it is released.
25
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
26
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
27
+ `git ls-files -z`.split("\x0").reject do |f|
28
+ (f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
29
+ end
30
+ end
31
+ spec.bindir = 'exe'
32
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
33
+ 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
40
+
41
+ spec.add_runtime_dependency 'rubocop'
42
+ end
data/tasks/changelog.rb CHANGED
@@ -9,7 +9,7 @@ class Changelog
9
9
  TYPE_TO_HEADER = { new: 'New features', fix: 'Bug fixes', change: 'Changes' }.freeze
10
10
  HEADER = /### (.*)/.freeze
11
11
  PATH = 'CHANGELOG.md'
12
- REF_URL = 'https://github.com/nebulab/rubocop-solidus'
12
+ REF_URL = 'https://github.com/solidusio/rubocop-solidus'
13
13
  MAX_LENGTH = 40
14
14
  CONTRIBUTOR = '[@%<user>s]: https://github.com/%<user>s'
15
15
  SIGNATURE = Regexp.new(format(Regexp.escape('[@%<user>s][]'), user: '([\w-]+)'))
@@ -64,8 +64,8 @@ class Changelog
64
64
  end
65
65
 
66
66
  def github_user
67
- user = `git config --global credential.username`.chomp
68
- warn 'Set your username with `git config --global credential.username "myusernamehere"`' if user.empty?
67
+ user = `git config --global user.username`.chomp
68
+ warn 'Set your username with `git config --global user.username "myusernamehere"`' if user.empty?
69
69
 
70
70
  user
71
71
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-solidus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - piyushswain
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-07-13 00:00:00.000000000 Z
11
+ date: 2023-07-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
@@ -35,6 +35,7 @@ extra_rdoc_files: []
35
35
  files:
36
36
  - ".rspec"
37
37
  - ".rubocop.yml"
38
+ - ".rubocop_todo.yml"
38
39
  - CHANGELOG.md
39
40
  - Gemfile
40
41
  - Gemfile.lock
@@ -58,18 +59,21 @@ files:
58
59
  - lib/rubocop/solidus.rb
59
60
  - lib/rubocop/solidus/inject.rb
60
61
  - lib/rubocop/solidus/version.rb
62
+ - relnotes/v0.1.2.md
63
+ - relnotes/v0.1.3.md
64
+ - rubocop-solidus.gemspec
61
65
  - sig/rubocop/solidus.rbs
62
66
  - tasks/changelog.rake
63
67
  - tasks/changelog.rb
64
68
  - tasks/cut_release.rake
65
- homepage: https://www.github.com/nebulab/rubocop-solidus
69
+ homepage: https://www.github.com/solidusio/rubocop-solidus
66
70
  licenses:
67
71
  - MIT
68
72
  metadata:
69
- homepage_uri: https://www.github.com/nebulab/rubocop-solidus
70
- source_code_uri: https://www.github.com/nebulab/rubocop-solidus
71
- changelog_uri: https://www.github.com/nebulab/rubocop-solidus
72
- post_install_message:
73
+ homepage_uri: https://www.github.com/solidusio/rubocop-solidus
74
+ source_code_uri: https://www.github.com/solidusio/rubocop-solidus
75
+ changelog_uri: https://www.github.com/solidusio/rubocop-solidus
76
+ post_install_message:
73
77
  rdoc_options: []
74
78
  require_paths:
75
79
  - lib
@@ -77,15 +81,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
77
81
  requirements:
78
82
  - - ">="
79
83
  - !ruby/object:Gem::Version
80
- version: 2.4.0
84
+ version: 2.7.0
81
85
  required_rubygems_version: !ruby/object:Gem::Requirement
82
86
  requirements:
83
87
  - - ">="
84
88
  - !ruby/object:Gem::Version
85
89
  version: '0'
86
90
  requirements: []
87
- rubygems_version: 3.3.17
88
- signing_key:
91
+ rubygems_version: 3.4.16
92
+ signing_key:
89
93
  specification_version: 4
90
94
  summary: Automatic Solidus code style checking tool.
91
95
  test_files: []