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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 362137ff4843ffbc2f8e9f968b3f38a958730432dfbd666fdb4af861801bc101
4
- data.tar.gz: b870f12eb48639ae83b0265574f75bab711bc6ffdc012c862e2599e6c47a0798
3
+ metadata.gz: cabfb06e68f5071fcad619e29b4533703f7f2004e8aae125c8bec9c53ac18831
4
+ data.tar.gz: b0a58acb5cba2edfbba85078b8321be54f572539f7deb6dfec0c8d812ec14ea8
5
5
  SHA512:
6
- metadata.gz: 8c9e6ce493a134b97d6cbee1123716e8de0ecd376b5690427497fafb4683904a9b5e30152aae47e8925f9a67e0a0417496daaa326f1e01c2c36ab5b37a2347d7
7
- data.tar.gz: 12cfdf90837ac5c54bf628ae475fd4b56b9b542ff58461d61fda880eefce8a6f828c7e9cefbe9a41d585d393d45342befcac4d6e1c73ab51911e7a6540fd31c2
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
- PRONTO_INFER_OUT_DIR=infer-out run --index
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:
@@ -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
- pattern = File.join(infer_out_dir, 'report.json')
43
- Dir.glob(pattern).flat_map(&method(:read_infer_report))
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(Dir.pwd, r['file']), r['line'], r['qualifier'])
54
+ Offence.new(File.join(infer_project_root_dir, r['file']), r['line'], r['qualifier'])
51
55
  end
52
56
  end
53
57
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Pronto
4
4
  module InferVersion
5
- VERSION = '0.1.0'
5
+ VERSION = '0.1.1'
6
6
  end
7
7
  end
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.0
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-07 00:00:00.000000000 Z
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
- rubygems_version: 3.0.3
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