rubocop-katalyst 1.1.4 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 813965be9e6b107ca9f01c57d01ca5674c9cafeac976d5ea4841e374afeb61e7
4
- data.tar.gz: 4ab544fdbe2d16323f93f6a3cd1064d770ac05bf036edf0db0d46de0b1f3dcb4
3
+ metadata.gz: 728f313a67cbfc6a84de24c0b735da29c94e35df87e00140ba561a51c9d30030
4
+ data.tar.gz: 48ff11dce02f4b6543a26ed2ac771c45dc02b5d24748ac793bd81f3c9e3ee9a3
5
5
  SHA512:
6
- metadata.gz: 5968dbc4666e584a9b23f72ef608061888a4d274fe4bbc43f27c7649692189aa3ad7e86db9a34eb437d26f5ce489f21c08327c1d9623d6efce11678a0223183b
7
- data.tar.gz: d346e2ac72baee66528414a9acb67db148a81841016c09919e66fec51997b6ca1811ec75bbf00fbb77a0956d5c6542c9e1a488f655a27bb5f23e1c267bc5d26d
6
+ metadata.gz: f9950c2818e4bd7835ba03b73f8fade998018b7f1267b49610f72757c880af5ac24d1b430c217c75d442db5babedac9d80b341887432ee2f17b02945c49d6176
7
+ data.tar.gz: bdd112f03aafa07fa4f8a16da306cd6576298f835bebf2f88659d9242aecadda444ce090ecbe481544edd5faad5416bfb7f3f2fff9394eefb8e801ed767cddd3
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## [2.0.0] - 2024-06-12
2
+
3
+ - Update ruby syntax to 3.3
4
+ - Update rubocop-rails to 3.0
5
+ - See rubocop-rails upgrade notes for more details
6
+
1
7
  ## [1.1.0] - 2023-05-19
2
8
 
3
9
  - Add erb_lint rake task and config (optional dependency)
data/README.md CHANGED
@@ -64,7 +64,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
64
64
 
65
65
  ## Contributing
66
66
 
67
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/rubocop-katalyst. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/katalyst/rubocop-katalyst/blob/main/CODE_OF_CONDUCT.md).
67
+ Bug reports and pull requests are welcome on GitHub at https://github.com/katalyst/rubocop-katalyst. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/katalyst/rubocop-katalyst/blob/main/CODE_OF_CONDUCT.md).
68
68
 
69
69
  ## License
70
70
 
data/config/default.yml CHANGED
@@ -1,9 +1,12 @@
1
1
  # Configuration for all cops and global extension configuration
2
2
  require:
3
+ - rubocop-capybara
4
+ - rubocop-factory_bot
3
5
  - rubocop-performance
4
6
  - rubocop-rails
5
7
  - rubocop-rake
6
8
  - rubocop-rspec
9
+ - rubocop-rspec_rails
7
10
 
8
11
  inherit_mode:
9
12
  merge:
@@ -24,12 +27,18 @@ inherit_from:
24
27
 
25
28
  AllCops:
26
29
  Exclude:
27
- - ".git/**/*"
28
- - "node_modules/**/*"
29
- - Dockerfile
30
- - docker-compose.yml
31
- NewCops: disable # review new cops for styleguide before including
32
- TargetRubyVersion: 2.7
30
+ - .git/**/*
31
+ - node_modules/**/*
32
+ - tmp/**/*
33
+ - vendor/**/*
34
+ NewCops: enable
35
+ TargetRubyVersion: 3.3
36
+
37
+ Capybara:
38
+ Enabled: true
39
+
40
+ FactoryBot:
41
+ Enabled: true
33
42
 
34
43
  Performance:
35
44
  Enabled: true
@@ -42,3 +51,6 @@ Rake:
42
51
 
43
52
  RSpec:
44
53
  Enabled: true
54
+
55
+ RSpecRails:
56
+ Enabled: true
@@ -1,2 +1,5 @@
1
1
  # Bundler configuration overrides
2
2
  # https://docs.rubocop.org/rubocop/1.5/cops_bundler.html
3
+
4
+ Bundler/OrderedGems:
5
+ Enabled: true
@@ -53,6 +53,14 @@ Rails/TimeZone:
53
53
  Reference: 'https://danilenko.org/2012/7/6/rails_timezones'
54
54
  Enabled: false
55
55
 
56
+ Rails/UnknownEnv:
57
+ Environments:
58
+ - production
59
+ - staging
60
+ - development
61
+ - test
62
+ Enabled: true
63
+
56
64
  Rails/Validation:
57
65
  Description: 'Use validates :attribute, hash of validations.'
58
66
  Enabled: false
@@ -13,6 +13,7 @@ RSpec/ContextWording:
13
13
  - without
14
14
 
15
15
  RSpec/ExampleLength:
16
+ CountAsOne: ["array", "heredoc", "method_call"]
16
17
  Exclude:
17
18
  - spec/features/**/*
18
19
  - spec/system/**/*
@@ -22,6 +23,9 @@ RSpec/MultipleExpectations:
22
23
  - spec/features/**/*
23
24
  - spec/system/**/*
24
25
 
26
+ RSpec/MultipleMemoizedHelpers:
27
+ Enabled: false
28
+
25
29
  RSpec/RepeatedExample:
26
30
  Exclude:
27
31
  - spec/policies/**/*
@@ -31,9 +31,10 @@ module RuboCop
31
31
  def run_cli(verbose, *options)
32
32
  require "erb_lint/cli"
33
33
 
34
+ options.unshift("--config", config.to_path, "--allow-no-files")
34
35
  cli = ERBLint::CLI.new
35
- puts "Running ERBLint" if verbose
36
- result = cli.run(["--config", config.to_path, *options])
36
+ puts "Running erbLint #{options.join(' ')}" if verbose
37
+ result = cli.run(options)
37
38
  abort("ERBLint failed!") unless result
38
39
  end
39
40
 
@@ -52,7 +53,7 @@ module RuboCop
52
53
  end
53
54
 
54
55
  def config
55
- config = ::Rails.application.root.join(".erb-lint.yml")
56
+ config = Pathname.new(root).join(".erb-lint.yml")
56
57
  config = default_config unless config.exist?
57
58
  config
58
59
  end
@@ -60,6 +61,10 @@ module RuboCop
60
61
  def default_config
61
62
  Pathname.new(__dir__).join("../../../.erb-lint.yml")
62
63
  end
64
+
65
+ def root
66
+ @root ||= Dir.pwd
67
+ end
63
68
  end
64
69
  end
65
70
  end
@@ -42,11 +42,9 @@ module RuboCop
42
42
 
43
43
  def install_prettier
44
44
  yarn("add", "--dev", "prettier")
45
- File.open(config, "w") do |f|
46
- f.write <<~JSON
47
- {}
48
- JSON
49
- end
45
+ File.write(config, <<~JSON)
46
+ {}
47
+ JSON
50
48
  yarn("install")
51
49
  end
52
50
 
@@ -11,7 +11,7 @@ module RuboCop
11
11
  class RakeTask < ::RuboCop::RakeTask
12
12
  attr_accessor :verbose
13
13
 
14
- def initialize(name = :rubocop, *args, &task_block)
14
+ def initialize(name = :rubocop, *, &)
15
15
  super
16
16
 
17
17
  task(lint: :rubocop)
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "katalyst/version"
4
-
5
3
  module RuboCop
6
4
  module Katalyst
7
5
  class Error < StandardError; end
@@ -8,7 +8,6 @@ require "rubocop-rspec"
8
8
 
9
9
  require_relative "rubocop/katalyst"
10
10
  require_relative "rubocop/katalyst/inject"
11
- require_relative "rubocop/katalyst/version"
12
11
 
13
12
  RuboCop::Katalyst::Inject.defaults!
14
13
 
data/package.json CHANGED
@@ -5,6 +5,6 @@
5
5
  "autocorrect": "prettier --write *.json app/assets/javascripts app/assets/stylesheets"
6
6
  },
7
7
  "devDependencies": {
8
- "prettier": "2.7.1"
8
+ "prettier": "3.3.2"
9
9
  }
10
10
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-katalyst
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.4
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Katalyst Interactive
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-01 00:00:00.000000000 Z
11
+ date: 2024-06-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
@@ -24,6 +24,34 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rubocop-capybara
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rubocop-factory_bot
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
27
55
  - !ruby/object:Gem::Dependency
28
56
  name: rubocop-performance
29
57
  requirement: !ruby/object:Gem::Requirement
@@ -80,7 +108,21 @@ dependencies:
80
108
  - - ">="
81
109
  - !ruby/object:Gem::Version
82
110
  version: '0'
83
- description: Custom RuboCop for the Katalyst styleguide
111
+ - !ruby/object:Gem::Dependency
112
+ name: rubocop-rspec_rails
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ description:
84
126
  email:
85
127
  - developers@katalyst.com.au
86
128
  executables: []
@@ -111,7 +153,6 @@ files:
111
153
  - lib/rubocop/katalyst/inject.rb
112
154
  - lib/rubocop/katalyst/prettier_task.rb
113
155
  - lib/rubocop/katalyst/rake_task.rb
114
- - lib/rubocop/katalyst/version.rb
115
156
  - lib/tasks/erb_lint.rake
116
157
  - package.json
117
158
  homepage: https://github.com/katalyst/rubocop-katalyst
@@ -119,11 +160,8 @@ licenses:
119
160
  - MIT
120
161
  metadata:
121
162
  allowed_push_host: https://rubygems.org
122
- homepage_uri: https://github.com/katalyst/rubocop-katalyst
123
- source_code_uri: https://github.com/katalyst/rubocop-katalyst
124
- changelog_uri: https://github.com/katalyst/rubocop-katalyst/blob/main/CHANGELOG.md
125
163
  rubygems_mfa_required: 'true'
126
- post_install_message:
164
+ post_install_message:
127
165
  rdoc_options: []
128
166
  require_paths:
129
167
  - lib
@@ -131,15 +169,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
131
169
  requirements:
132
170
  - - ">="
133
171
  - !ruby/object:Gem::Version
134
- version: 2.7.0
172
+ version: '3.3'
135
173
  required_rubygems_version: !ruby/object:Gem::Requirement
136
174
  requirements:
137
175
  - - ">="
138
176
  - !ruby/object:Gem::Version
139
177
  version: '0'
140
178
  requirements: []
141
- rubygems_version: 3.4.12
142
- signing_key:
179
+ rubygems_version: 3.5.9
180
+ signing_key:
143
181
  specification_version: 4
144
182
  summary: Code standards for Katalyst
145
183
  test_files: []
@@ -1,7 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module RuboCop
4
- module Katalyst
5
- VERSION = "1.1.4"
6
- end
7
- end