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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 59ca43ac3be906fb556abf46c2ce068efc8947751f28ad4ae8a9261756c9fba3
4
- data.tar.gz: e94560794e1ffb3c8939956773591940e251e8eee6cb0cb6217028e145f1faaf
3
+ metadata.gz: 2a825d18e3f5825299c0d0e6af7682e3a1f8aa2bc2a030a96a807eaa12aced63
4
+ data.tar.gz: c001a2068adb09a8c9610130da10d4ce9bdbb4e534c587b28a13ba53ad1fe42b
5
5
  SHA512:
6
- metadata.gz: e815486f76603036c9584ccaf3cfd23a4fd9a3c7ee7e33838af1c552b1ae7f64ca99c8c0309929fd5d889c3f10fca408e3dd60bc8cde61d64ec49080d0073ac8
7
- data.tar.gz: d0bc712dd52531123eb3377c9bbbba1334b9d0a2e302eb955549157aa71a1dd5a48d7c9733f9fe449c2cfc369117e3cb96a21bf4794094a649744d0f10c30cb2
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
- Or install it yourself as:
18
-
19
- $ gem install ruby-lsp-reek
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
 
@@ -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.init!
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
 
@@ -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
- return [] if config.path_excluded?(Pathname.new(uri.path))
27
+ path = Pathname.new(uri.path)
28
+ return [] if path_excluded?(path)
28
29
 
29
- examiner = ::Reek::Examiner.new(document.source, configuration: config)
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RubyLsp
4
4
  module Reek
5
- VERSION = "0.1.0"
5
+ VERSION = "0.3.0"
6
6
  end
7
7
  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.1.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 LSP Reek
197
+ summary: Reek addon for Ruby-LSP
198
198
  test_files: []