ruby-lsp-reek 0.1.0 → 0.3.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/README.md +3 -3
- data/lib/ruby_lsp/reek/addon.rb +1 -1
- data/lib/ruby_lsp/reek/runner.rb +11 -2
- data/lib/ruby_lsp/reek/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a825d18e3f5825299c0d0e6af7682e3a1f8aa2bc2a030a96a807eaa12aced63
|
4
|
+
data.tar.gz: c001a2068adb09a8c9610130da10d4ce9bdbb4e534c587b28a13ba53ad1fe42b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0cec537f3c7d5d39842c75a6715b54ae39999784bedc3b331b2f98effc248847b4a8daf534e193ae055a68b0aeef3b3f5af17b5aae7610510bb095b578dfbf3f
|
7
|
+
data.tar.gz: 3b8f36ccfc2455b2af3c6bb548c67b95e1ce95a72f98ed55138ec5efebf237fe2d2453822f09eef1bb902490794f2e6dcc1efb67fa793f083dea65e725ac5040
|
data/README.md
CHANGED
@@ -14,9 +14,9 @@ And then execute:
|
|
14
14
|
|
15
15
|
$ bundle
|
16
16
|
|
17
|
-
|
18
|
-
|
19
|
-
|
17
|
+
Note: Using globally installed linters in Ruby LSP is [not
|
18
|
+
supported](https://github.com/Shopify/ruby-lsp/blob/main/vscode/README.md#formatting),
|
19
|
+
they must in your Gemfile or gemspec.
|
20
20
|
|
21
21
|
## Usage
|
22
22
|
|
data/lib/ruby_lsp/reek/addon.rb
CHANGED
@@ -68,7 +68,7 @@ module RubyLsp
|
|
68
68
|
def workspace_did_change_watched_files(changes)
|
69
69
|
return unless changes.any? { |change| change[:uri].end_with?(".reek.yml") }
|
70
70
|
|
71
|
-
runner.
|
71
|
+
@runner = Runner.new
|
72
72
|
warn "Re-initialized Reek Ruby LSP addon v#{::RubyLsp::Reek::VERSION} due to .reek.yml file change"
|
73
73
|
end
|
74
74
|
|
data/lib/ruby_lsp/reek/runner.rb
CHANGED
@@ -24,9 +24,10 @@ module RubyLsp
|
|
24
24
|
# @param uri [String] The URI of the document to run diagnostics on.
|
25
25
|
# @param document [RubyLsp::Interface::TextDocumentItem] The document to run diagnostics on.
|
26
26
|
def run_diagnostic(uri, document)
|
27
|
-
|
27
|
+
path = Pathname.new(uri.path)
|
28
|
+
return [] if path_excluded?(path)
|
28
29
|
|
29
|
-
examiner = ::Reek::Examiner.new(
|
30
|
+
examiner = ::Reek::Examiner.new(path, configuration: config)
|
30
31
|
examiner.smells.map { |smell| warning_to_diagnostic(smell) }
|
31
32
|
end
|
32
33
|
|
@@ -56,6 +57,14 @@ module RubyLsp
|
|
56
57
|
message: warning.message
|
57
58
|
)
|
58
59
|
end
|
60
|
+
|
61
|
+
def path_excluded?(path)
|
62
|
+
path.ascend do |ascendant|
|
63
|
+
break true if config.path_excluded?(ascendant)
|
64
|
+
|
65
|
+
false
|
66
|
+
end
|
67
|
+
end
|
59
68
|
end
|
60
69
|
end
|
61
70
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-lsp-reek
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Iain Gray
|
@@ -194,5 +194,5 @@ requirements: []
|
|
194
194
|
rubygems_version: 3.5.11
|
195
195
|
signing_key:
|
196
196
|
specification_version: 4
|
197
|
-
summary: Ruby
|
197
|
+
summary: Reek addon for Ruby-LSP
|
198
198
|
test_files: []
|