pronto-infer 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -2
- data/lib/pronto/infer.rb +7 -3
- data/lib/pronto/infer/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cabfb06e68f5071fcad619e29b4533703f7f2004e8aae125c8bec9c53ac18831
|
4
|
+
data.tar.gz: b0a58acb5cba2edfbba85078b8321be54f572539f7deb6dfec0c8d812ec14ea8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d493020424658852a554d3438e705e44434559c015732b59c3758b84f385b294aa4060b9f6de99596d6d27c5fc0a91c7c13d01668d9064fd682734e16ca3a429
|
7
|
+
data.tar.gz: 78f2deb1e3c212a38fd98eb4bd2b9e5744bf73443d699643ee559364edc7b5c816ec02d842f03302cc042bc130bb1436d78846541357888acb7511de204fd49f
|
data/README.md
CHANGED
@@ -11,7 +11,9 @@
|
|
11
11
|
You need to specify location of infer output by passing `PRONTO_INFER_OUT_DIR` env variable e.g:
|
12
12
|
|
13
13
|
```bash
|
14
|
-
|
14
|
+
> export PRONTO_INFER_PROJECT_ROOT_DIR=. # NOTE: optional
|
15
|
+
> export PRONTO_INFER_OUT_DIR=infer-out
|
16
|
+
> pronto run --index
|
15
17
|
```
|
16
18
|
|
17
19
|
See [seikichi/pronto-infer-example](https://github.com/seikichi/pronto-infer-example) for more details.
|
@@ -21,7 +23,7 @@ See [seikichi/pronto-infer-example](https://github.com/seikichi/pronto-infer-exa
|
|
21
23
|
Add this line to your application's Gemfile:
|
22
24
|
|
23
25
|
```ruby
|
24
|
-
gem 'pronto-infer
|
26
|
+
gem 'pronto-infer'
|
25
27
|
```
|
26
28
|
|
27
29
|
And then execute:
|
data/lib/pronto/infer.rb
CHANGED
@@ -22,6 +22,10 @@ module Pronto
|
|
22
22
|
ENV['PRONTO_INFER_OUT_DIR'] || (raise 'Please set `PRONTO_INFER_OUT_DIR` to use pronto-infer')
|
23
23
|
end
|
24
24
|
|
25
|
+
def infer_project_root_dir
|
26
|
+
File.expand_path(ENV['PRONTO_INFER_PROJECT_ROOT_DIR'] || '.')
|
27
|
+
end
|
28
|
+
|
25
29
|
def valid_patch?(patch)
|
26
30
|
patch.additions.positive?
|
27
31
|
end
|
@@ -39,15 +43,15 @@ module Pronto
|
|
39
43
|
def infer_offences
|
40
44
|
@infer_offences ||=
|
41
45
|
begin
|
42
|
-
|
43
|
-
|
46
|
+
path = File.join(infer_out_dir, 'report.json')
|
47
|
+
read_infer_report(path)
|
44
48
|
end
|
45
49
|
end
|
46
50
|
|
47
51
|
def read_infer_report(path)
|
48
52
|
report = JSON.parse(File.read(path))
|
49
53
|
report.map do |r|
|
50
|
-
Offence.new(File.join(
|
54
|
+
Offence.new(File.join(infer_project_root_dir, r['file']), r['line'], r['qualifier'])
|
51
55
|
end
|
52
56
|
end
|
53
57
|
|
data/lib/pronto/infer/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pronto-infer
|
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
|
- Seiichi KONDO
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-06-
|
11
|
+
date: 2020-06-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pronto
|
@@ -164,7 +164,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
164
164
|
- !ruby/object:Gem::Version
|
165
165
|
version: '0'
|
166
166
|
requirements: []
|
167
|
-
|
167
|
+
rubyforge_project:
|
168
|
+
rubygems_version: 2.7.6
|
168
169
|
signing_key:
|
169
170
|
specification_version: 4
|
170
171
|
summary: Pronto runner for infer
|