solargraph-reek 0.1.0 → 0.1.1
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/CHANGELOG.md +4 -0
- data/lib/solargraph-reek/version.rb +5 -5
- data/lib/solargraph-reek.rb +37 -31
- metadata +8 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f45fcb15b2ee755fdb94c4afd8a71cdc522d5feb9fbc5267835501a739fe4bba
|
|
4
|
+
data.tar.gz: 88d4b4ef2a83d465f0476fdd62a3d631abab85bab5cbae06b9c7427ae54b89bc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8203374d992c26c1e62f14f6c243bb09486db2a8803e74a338b6a8f3564971d834ac056e316e6408d6de616a96c6372e5dc5dc614473f2de6a6b34e208c47c1a
|
|
7
|
+
data.tar.gz: bd6b362bdca099f67d6a54e954f875b950068c0ef842dbb580f8ae0e1d19165239e45f6bd996837d4abc4e157d247f0dbd8e409e907aea42d906d061f5d05f73
|
data/CHANGELOG.md
ADDED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
module Solargraph
|
|
2
|
-
module Reek
|
|
3
|
-
VERSION = "0.1.
|
|
4
|
-
end
|
|
5
|
-
end
|
|
1
|
+
module Solargraph
|
|
2
|
+
module Reek
|
|
3
|
+
VERSION = "0.1.1"
|
|
4
|
+
end
|
|
5
|
+
end
|
data/lib/solargraph-reek.rb
CHANGED
|
@@ -1,31 +1,37 @@
|
|
|
1
|
-
require 'solargraph'
|
|
2
|
-
require 'solargraph-reek/version'
|
|
3
|
-
require 'reek'
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
1
|
+
require 'solargraph'
|
|
2
|
+
require 'solargraph-reek/version'
|
|
3
|
+
require 'reek'
|
|
4
|
+
require 'pathname'
|
|
5
|
+
|
|
6
|
+
module Solargraph
|
|
7
|
+
module Reek
|
|
8
|
+
class Reporter < Solargraph::Diagnostics::Base
|
|
9
|
+
def diagnose(source, _api_map)
|
|
10
|
+
configuration = ::Reek::Configuration::AppConfiguration.from_default_path
|
|
11
|
+
source_pathname = Pathname.new(source.filename)
|
|
12
|
+
|
|
13
|
+
return [] if configuration.path_excluded?(source_pathname)
|
|
14
|
+
|
|
15
|
+
examiner = ::Reek::Examiner.new(source_pathname, configuration: configuration)
|
|
16
|
+
examiner.smells.map { |w| warning_to_diagnostic(w) }
|
|
17
|
+
rescue ::Reek::Errors::SyntaxError
|
|
18
|
+
[]
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
private
|
|
22
|
+
|
|
23
|
+
# @param warning [::Reek::SmellWarning]
|
|
24
|
+
# @return [Hash]
|
|
25
|
+
def warning_to_diagnostic(warning)
|
|
26
|
+
{
|
|
27
|
+
range: Solargraph::Range.from_to(warning.lines.first - 1, 0, warning.lines.last, 0).to_hash,
|
|
28
|
+
severity: Diagnostics::Severities::WARNING,
|
|
29
|
+
source: 'Reek',
|
|
30
|
+
message: "[#{warning.smell_type}] #{warning.message}"
|
|
31
|
+
}
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
Solargraph::Diagnostics.register 'reek', Solargraph::Reek::Reporter
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: solargraph-reek
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Fred Snyder
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2022-12-09 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: reek
|
|
@@ -80,7 +80,7 @@ dependencies:
|
|
|
80
80
|
- - "~>"
|
|
81
81
|
- !ruby/object:Gem::Version
|
|
82
82
|
version: '3.0'
|
|
83
|
-
description:
|
|
83
|
+
description:
|
|
84
84
|
email:
|
|
85
85
|
- fsnyder@castwide.com
|
|
86
86
|
executables: []
|
|
@@ -90,6 +90,7 @@ files:
|
|
|
90
90
|
- ".gitignore"
|
|
91
91
|
- ".rspec"
|
|
92
92
|
- ".travis.yml"
|
|
93
|
+
- CHANGELOG.md
|
|
93
94
|
- Gemfile
|
|
94
95
|
- LICENSE.txt
|
|
95
96
|
- README.md
|
|
@@ -103,7 +104,7 @@ homepage: https://solargraph.org
|
|
|
103
104
|
licenses:
|
|
104
105
|
- MIT
|
|
105
106
|
metadata: {}
|
|
106
|
-
post_install_message:
|
|
107
|
+
post_install_message:
|
|
107
108
|
rdoc_options: []
|
|
108
109
|
require_paths:
|
|
109
110
|
- lib
|
|
@@ -118,8 +119,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
118
119
|
- !ruby/object:Gem::Version
|
|
119
120
|
version: '0'
|
|
120
121
|
requirements: []
|
|
121
|
-
rubygems_version: 3.
|
|
122
|
-
signing_key:
|
|
122
|
+
rubygems_version: 3.3.7
|
|
123
|
+
signing_key:
|
|
123
124
|
specification_version: 4
|
|
124
125
|
summary: A Reek diagnostics reporter for Solargraph
|
|
125
126
|
test_files: []
|