pronto-goodcheck 0.1.2 → 0.2.0

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: c779e518cbbe0d9e12188b7aed7aeedef787f10708e6178105bc2e1ede149f6b
4
- data.tar.gz: 2b810907d2548e08f564970eb92f5136a8664cc52768ef218521d563d815deed
3
+ metadata.gz: 883d98d9920e48fcb54226b917c0bdb348ec14716084f59f49cfbfba8ea1a336
4
+ data.tar.gz: ff2ef585fed8c532d2e6122caa852b1b626859255f51e9ddaaa1f7e8364e5b74
5
5
  SHA512:
6
- metadata.gz: 821a4e504101a687e933487a2ed4b4e5d31d630e3e957854c491a9d78b3c4d6808cd5927ca3bb9cb33ab78cd97b31fcc279b70d2c482bc2c8220890962291da5
7
- data.tar.gz: e6c4bc2f7928a8ff2fd74d5bc36b924fdb57096fa74a3e2c2626c2816e4a54b0254db1f798eaab855a6e8e2888dad5a3a8a52298fed7d690ec873ed2f2619cb5
6
+ metadata.gz: 99d6e25b71bcbf628f5a15387f60a62ee30f8fbfd6546e11bdcb997df5c4063738d2a76aea4eed653d54222be4f1aaf5498638e858fbdc3e03fa5c324a196152
7
+ data.tar.gz: a31a8627a5bd4ea5e75a81dc0bf0dda85e5a5fbfc455a6510feb823ef887fd939658d3253333a7551f04752c841469ccd7ee4392313c6f276fde2620a1169d12
@@ -7,16 +7,22 @@ require "json"
7
7
  module Pronto
8
8
  class GoodcheckRunner < Runner
9
9
  def run
10
- files = patches_with_changes.map(&:new_file_full_path)
10
+ files = patches_with_changes
11
+ .map { |patch| project_relative_path(patch) }
11
12
  stdout = StringIO.new
12
13
  stderr = StringIO.new
13
- reporter = ::Goodcheck::Reporters::JSON.new(stdout: stdout, stderr: stderr)
14
+ reporter = ::Goodcheck::Reporters::JSON.new(
15
+ stdout: stdout,
16
+ stderr: stderr,
17
+ )
14
18
  runner = ::Goodcheck::Commands::Check.new(
15
19
  config_path: Pathname("goodcheck.yml"),
16
20
  rules: [],
17
21
  targets: files,
18
22
  reporter: reporter,
19
- stderr: stderr
23
+ stderr: stderr,
24
+ home_path: goodcheck_home_path,
25
+ force_download: false,
20
26
  )
21
27
  runner.run
22
28
  analysis = JSON.load(stdout.string)
@@ -44,7 +50,7 @@ module Pronto
44
50
 
45
51
  def patch_for_issue(issue)
46
52
  patches_with_changes.find do |patch|
47
- patch.new_file_full_path.to_s == issue["path"]
53
+ patch.delta.new_file[:path].to_s == issue["path"]
48
54
  end
49
55
  end
50
56
 
@@ -61,5 +67,17 @@ module Pronto
61
67
 
62
68
  Message.new(path, line, :info, message, nil, self.class)
63
69
  end
70
+
71
+ def goodcheck_home_path
72
+ if (path = ENV["GOODCHECK_HOME"])
73
+ Pathname(path)
74
+ else
75
+ Pathname(Dir.home) + ".goodcheck"
76
+ end
77
+ end
78
+
79
+ def project_relative_path(patch)
80
+ Pathname(patch.delta.new_file[:path])
81
+ end
64
82
  end
65
83
  end
@@ -1,5 +1,5 @@
1
1
  module Pronto
2
2
  module Goodcheck
3
- VERSION = "0.1.2"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
21
21
  spec.require_paths = ["lib"]
22
22
 
23
- spec.add_dependency "goodcheck", ">= 1.2.0"
23
+ spec.add_dependency "goodcheck", ">= 1.5.0"
24
24
  spec.add_dependency "pronto", ">= 0.9.5"
25
25
 
26
26
  spec.add_development_dependency "bundler", "~> 1.15"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pronto-goodcheck
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Fung
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-08-20 00:00:00.000000000 Z
11
+ date: 2019-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: goodcheck
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 1.2.0
19
+ version: 1.5.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 1.2.0
26
+ version: 1.5.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: pronto
29
29
  requirement: !ruby/object:Gem::Requirement