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 +4 -4
- data/.github/workflows/ci.yml +2 -2
- data/.streerc +2 -0
- data/Gemfile +2 -1
- data/lib/rubocop/discourse/plugin.rb +28 -0
- data/lib/rubocop/discourse/version.rb +7 -0
- data/lib/rubocop-discourse.rb +3 -5
- data/rubocop-discourse.gemspec +8 -2
- data/rubocop-rails.yml +1 -1
- data/rubocop-rspec.yml +3 -1
- data/stree-compat.yml +2 -2
- metadata +23 -7
- data/lib/rubocop/discourse/inject.rb +0 -18
- data/lib/rubocop/discourse.rb +0 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4648e09304959a3f22318ef9baf648c09462f73f160e04a67b8df867496cca11
|
4
|
+
data.tar.gz: acf98a1d3d919939d40c89f2007e29f734f9bd78b1f52f94cfd32dde8c73f81d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c272e1f33440930bb5a378a2b2014cf2d64a2a05ea94ac32a089bf5403ab6974483ffe795cb74a66df7a060490c513ecfbf9b26f806af24094afc51f3798b7d
|
7
|
+
data.tar.gz: 648a590086786be389403cd4edc7d1a8a0b58f84e66e44ae4619bafd63be92391331687957bc5f69edba994d082cb2f7bf7a782fe0d36249800c1eac57e714c3
|
data/.github/workflows/ci.yml
CHANGED
@@ -11,7 +11,7 @@ jobs:
|
|
11
11
|
runs-on: ubuntu-latest
|
12
12
|
|
13
13
|
steps:
|
14
|
-
- uses: actions/checkout@
|
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@
|
34
|
+
- uses: actions/checkout@v4
|
35
35
|
|
36
36
|
- name: Release Gem
|
37
37
|
uses: discourse/publish-rubygems-action@v3
|
data/.streerc
ADDED
data/Gemfile
CHANGED
@@ -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
|
data/lib/rubocop-discourse.rb
CHANGED
@@ -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"
|
data/rubocop-discourse.gemspec
CHANGED
@@ -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 =
|
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.
|
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
data/rubocop-rspec.yml
CHANGED
data/stree-compat.yml
CHANGED
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.
|
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-
|
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.
|
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.
|
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/
|
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
|
data/lib/rubocop/discourse.rb
DELETED
@@ -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
|