rubocop-katalyst 1.1.3 → 2.0.0

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: ddc6b3c8cce60c0fcdaf1e82f6e870136495a8a4be758e1f00d2e74c4041b6f0
4
- data.tar.gz: af751b20b7a7a23a11f2127af97c2b6a2cb92b7ad52aa991f7ffa1d81de9755b
3
+ metadata.gz: e750b4c719c39526276ce85557d2fa953130f440d113619f1348a8cf98fde5f1
4
+ data.tar.gz: 3263ad867d1e322185d4e8cbcf2f56bc893f0eed2a368debadac7cecf6391b32
5
5
  SHA512:
6
- metadata.gz: 70bf3a16f5ba638f9e7ec0e66f428f9e4383046bd1816fbdf6cfff2ff8d2fed11636203c31a0027775341d29f168cc1f5c21e0467be717db7af85f8728fd4794
7
- data.tar.gz: 8e37ed6686f578b0b4e2605082dc07638aadfdce2a7c9d7079f60092c64717e2469aab9c49e3cc2f532bc1dee0518bea1bd69e59cbc7aa2d8cfcd928997cf945
6
+ metadata.gz: 25886809eb3a08a17ad02e206fbadc8cbf8d7b86f7e5f5dc0ba4b2a96c769958602999d668a43e3b181c912b41777c828364562bcde69623b79f52c0beb0d181
7
+ data.tar.gz: 4670dea507d6782b16d1198bcf12a3fcb00eacb60457a1b6a69b8bb9eb7c6ef31a316786110059fe10bd313e58e92332a53a26f8e4aed1435e9e59a7e931a4be
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,17 @@ 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
+ - vendor/bundle/**/*
33
+ NewCops: enable
34
+ TargetRubyVersion: 3.3
35
+
36
+ Capybara:
37
+ Enabled: true
38
+
39
+ FactoryBot:
40
+ Enabled: true
33
41
 
34
42
  Performance:
35
43
  Enabled: true
@@ -42,3 +50,6 @@ Rake:
42
50
 
43
51
  RSpec:
44
52
  Enabled: true
53
+
54
+ RSpecRails:
55
+ 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
@@ -22,6 +22,9 @@ RSpec/MultipleExpectations:
22
22
  - spec/features/**/*
23
23
  - spec/system/**/*
24
24
 
25
+ RSpec/MultipleMemoizedHelpers:
26
+ Enabled: false
27
+
25
28
  RSpec/RepeatedExample:
26
29
  Exclude:
27
30
  - 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
- config.open("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
 
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.3
4
+ version: 2.0.0
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-12 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.3"
6
- end
7
- end