rubocop-discourse 3.9.3 → 3.11.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4003717b78bca02f538f48bc23fdd1b0e913bb6816c5d6a1e87401c53c167a14
4
- data.tar.gz: acba524c9e7e399a5b69974ce94dfefa33fbd61c5c2197ecb425b1ed22418e23
3
+ metadata.gz: 4648e09304959a3f22318ef9baf648c09462f73f160e04a67b8df867496cca11
4
+ data.tar.gz: acf98a1d3d919939d40c89f2007e29f734f9bd78b1f52f94cfd32dde8c73f81d
5
5
  SHA512:
6
- metadata.gz: 9fd47066d7d8066da4adb2f17d95de3420fbaae18599d07925671a28c58a95a2d39b4ba8319813a0daf2106e7ecce4407a99470a93f2d99f335147bad3142269
7
- data.tar.gz: 311df91f7d4cf9b5e296d3dcbf625482a0fdea6ac1da33fe389b7db41ec0339b4918434ce97a13c023ba86e3a54eb81edcb512aba7cb9abd0a21b19bb5b5527d
6
+ metadata.gz: 4c272e1f33440930bb5a378a2b2014cf2d64a2a05ea94ac32a089bf5403ab6974483ffe795cb74a66df7a060490c513ecfbf9b26f806af24094afc51f3798b7d
7
+ data.tar.gz: 648a590086786be389403cd4edc7d1a8a0b58f84e66e44ae4619bafd63be92391331687957bc5f69edba994d082cb2f7bf7a782fe0d36249800c1eac57e714c3
@@ -11,7 +11,7 @@ jobs:
11
11
  runs-on: ubuntu-latest
12
12
 
13
13
  steps:
14
- - uses: actions/checkout@v3
14
+ - uses: actions/checkout@v4
15
15
 
16
16
  - name: Setup ruby
17
17
  uses: ruby/setup-ruby@v1
@@ -31,7 +31,7 @@ jobs:
31
31
  runs-on: ubuntu-latest
32
32
 
33
33
  steps:
34
- - uses: actions/checkout@v3
34
+ - uses: actions/checkout@v4
35
35
 
36
36
  - name: Release Gem
37
37
  uses: discourse/publish-rubygems-action@v3
data/.streerc ADDED
@@ -0,0 +1,2 @@
1
+ --print-width=100
2
+ --plugins=plugin/trailing_comma,plugin/disable_auto_ternary
data/Gemfile CHANGED
@@ -6,5 +6,6 @@ source "https://rubygems.org"
6
6
  gemspec
7
7
 
8
8
  group :development, :test do
9
- gem 'byebug'
9
+ gem "syntax_tree"
10
+ gem "byebug"
10
11
  end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RuboCop
4
+ module Discourse
5
+ class Plugin < LintRoller::Plugin
6
+ def about
7
+ LintRoller::About.new(
8
+ name: "rubocop-discourse",
9
+ version: RuboCop::Discourse::VERSION,
10
+ homepage: "https://github.com/discourse/rubocop-discourse",
11
+ description: "Custom rubocop cops used by Discourse",
12
+ )
13
+ end
14
+
15
+ def supported?(context)
16
+ context.engine == :rubocop
17
+ end
18
+
19
+ def rules(_context)
20
+ LintRoller::Rules.new(
21
+ type: :path,
22
+ config_format: :rubocop,
23
+ value: Pathname.new(__dir__).join("../../../config/default.yml"),
24
+ )
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RuboCop
4
+ module Discourse
5
+ VERSION = "3.11.0"
6
+ end
7
+ end
@@ -1,13 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "rubocop"
4
+ require "lint_roller"
4
5
  require "active_support"
5
6
  require "active_support/core_ext/string/inflections"
6
7
  require "active_support/core_ext/object/blank"
7
8
  require "active_support/core_ext/enumerable"
8
- require_relative "rubocop/discourse"
9
- require_relative "rubocop/discourse/inject"
10
-
11
- RuboCop::Discourse::Inject.defaults!
12
-
13
9
  require_relative "rubocop/cop/discourse_cops"
10
+ require_relative "rubocop/discourse/version"
11
+ require_relative "rubocop/discourse/plugin"
@@ -1,8 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ lib = File.expand_path("lib", __dir__)
4
+ $LOAD_PATH.unshift(lib) if !$LOAD_PATH.include?(lib)
5
+ require "rubocop/discourse/version"
6
+
3
7
  Gem::Specification.new do |s|
4
8
  s.name = "rubocop-discourse"
5
- s.version = "3.9.3"
9
+ s.version = RuboCop::Discourse::VERSION
6
10
  s.summary = "Custom rubocop cops used by Discourse"
7
11
  s.authors = ["Discourse Team"]
8
12
  s.license = "MIT"
@@ -10,14 +14,16 @@ Gem::Specification.new do |s|
10
14
 
11
15
  s.files = `git ls-files`.split($/)
12
16
  s.require_paths = ["lib"]
17
+ s.metadata["default_lint_roller_plugin"] = "RuboCop::Discourse::Plugin"
13
18
 
14
19
  s.add_runtime_dependency "activesupport", ">= 6.1"
15
- s.add_runtime_dependency "rubocop", ">= 1.59.0"
20
+ s.add_runtime_dependency "rubocop", ">= 1.72.0"
16
21
  s.add_runtime_dependency "rubocop-rspec", ">= 3.0.1"
17
22
  s.add_runtime_dependency "rubocop-factory_bot", ">= 2.0.0"
18
23
  s.add_runtime_dependency "rubocop-capybara", ">= 2.0.0"
19
24
  s.add_runtime_dependency "rubocop-rails", ">= 2.25.0"
20
25
  s.add_runtime_dependency "rubocop-rspec_rails", ">= 2.30.0"
26
+ s.add_runtime_dependency "lint_roller", ">= 1.1.0"
21
27
 
22
28
  s.add_development_dependency "rake", "~> 13.1.0"
23
29
  s.add_development_dependency "rspec", "~> 3.12.0"
data/rubocop-rails.yml CHANGED
@@ -1,4 +1,4 @@
1
- require:
1
+ plugins:
2
2
  - rubocop-rails
3
3
 
4
4
  Rails:
data/rubocop-rspec.yml CHANGED
@@ -1,5 +1,7 @@
1
- require:
1
+ plugins:
2
2
  - rubocop-rspec
3
+
4
+ require:
3
5
  - rubocop-rspec_rails
4
6
 
5
7
  RSpec/AnyInstance:
data/stree-compat.yml CHANGED
@@ -1,4 +1,4 @@
1
- require:
1
+ plugins:
2
2
  - rubocop-discourse
3
3
 
4
4
  inherit_from:
@@ -9,7 +9,7 @@ inherit_from:
9
9
  - ./rubocop-rails.yml
10
10
 
11
11
  AllCops:
12
- TargetRubyVersion: 3.2
12
+ TargetRubyVersion: "3.3"
13
13
  SuggestExtensions: false
14
14
  DisabledByDefault: true
15
15
  Exclude:
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-discourse
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.9.3
4
+ version: 3.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Discourse Team
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-01-31 00:00:00.000000000 Z
10
+ date: 2025-03-04 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: activesupport
@@ -29,14 +29,14 @@ dependencies:
29
29
  requirements:
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: 1.59.0
32
+ version: 1.72.0
33
33
  type: :runtime
34
34
  prerelease: false
35
35
  version_requirements: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - ">="
38
38
  - !ruby/object:Gem::Version
39
- version: 1.59.0
39
+ version: 1.72.0
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: rubocop-rspec
42
42
  requirement: !ruby/object:Gem::Requirement
@@ -107,6 +107,20 @@ dependencies:
107
107
  - - ">="
108
108
  - !ruby/object:Gem::Version
109
109
  version: 2.30.0
110
+ - !ruby/object:Gem::Dependency
111
+ name: lint_roller
112
+ requirement: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - ">="
115
+ - !ruby/object:Gem::Version
116
+ version: 1.1.0
117
+ type: :runtime
118
+ prerelease: false
119
+ version_requirements: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - ">="
122
+ - !ruby/object:Gem::Version
123
+ version: 1.1.0
110
124
  - !ruby/object:Gem::Dependency
111
125
  name: rake
112
126
  requirement: !ruby/object:Gem::Requirement
@@ -143,6 +157,7 @@ files:
143
157
  - ".gitignore"
144
158
  - ".rspec"
145
159
  - ".rubocop.yml"
160
+ - ".streerc"
146
161
  - Gemfile
147
162
  - LICENSE
148
163
  - README.md
@@ -172,8 +187,8 @@ files:
172
187
  - lib/rubocop/cop/discourse/services/group_keywords.rb
173
188
  - lib/rubocop/cop/discourse/time_eq_matcher.rb
174
189
  - lib/rubocop/cop/discourse_cops.rb
175
- - lib/rubocop/discourse.rb
176
- - lib/rubocop/discourse/inject.rb
190
+ - lib/rubocop/discourse/plugin.rb
191
+ - lib/rubocop/discourse/version.rb
177
192
  - rubocop-capybara.yml
178
193
  - rubocop-core.yml
179
194
  - rubocop-discourse.gemspec
@@ -208,7 +223,8 @@ files:
208
223
  homepage: https://github.com/discourse/rubocop-discourse
209
224
  licenses:
210
225
  - MIT
211
- metadata: {}
226
+ metadata:
227
+ default_lint_roller_plugin: RuboCop::Discourse::Plugin
212
228
  rdoc_options: []
213
229
  require_paths:
214
230
  - lib
@@ -1,18 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module RuboCop
4
- module Discourse
5
- # Because RuboCop doesn't yet support plugins, we have to monkey patch in a
6
- # bit of our configuration.
7
- module Inject
8
- def self.defaults!
9
- path = CONFIG_DEFAULT.to_s
10
- hash = ConfigLoader.send(:load_yaml_configuration, path)
11
- config = Config.new(hash, path)
12
- puts "configuration from #{path}" if ConfigLoader.debug?
13
- config = ConfigLoader.merge_with_default(config, path)
14
- ConfigLoader.instance_variable_set(:@default_configuration, config)
15
- end
16
- end
17
- end
18
- end
@@ -1,12 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module RuboCop
4
- # RuboCop Discourse project namespace
5
- module Discourse
6
- PROJECT_ROOT = Pathname.new(__dir__).parent.parent.expand_path.freeze
7
- CONFIG_DEFAULT = PROJECT_ROOT.join("config", "default.yml").freeze
8
- CONFIG = YAML.safe_load(CONFIG_DEFAULT.read).freeze
9
-
10
- private_constant(:CONFIG_DEFAULT, :PROJECT_ROOT)
11
- end
12
- end