pronto-golang 0.0.11 → 0.0.12

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: 71b73839c9ca428457695dbbc4758df2a5e0c77547e8448d36c673fa0d453a08
4
- data.tar.gz: e3a84a4ceeb6431d204e3b7cb1cf07ba5b53502ab0cb50e439b58ab4bef423a1
3
+ metadata.gz: aef845e2e4afb8599a35044ce4a59a07443dc4d405128dc33c093ee084932a0e
4
+ data.tar.gz: c2a3e0095846f6fb6b6c76710e98df3397deed37ada5c674935eeac7d262b54c
5
5
  SHA512:
6
- metadata.gz: e9b797ba16cb7e265bd2fda0458fccc6bbe535a48dd41235c2e24a61d1833384c822357eaabc557d139f05e839d198909efdf6403fe64bf9ff6cbf1b55acaf98
7
- data.tar.gz: fe5375cea51db2e86bb1192ac4752597510860626ee43e04c4a4b19928fcc0bc5e5a0f57e35ca9c099aaff313c7b73403be2ae079d76396aa257cf564344af71
6
+ metadata.gz: 9aa29a44ed4283fe5f1a59a85a7112dcfb116cbba9f9a7924e1fa3a8ebabad988fa723cc3042b1ea9ec39bdca642727e1419fe050b1b147c33cae0bced346fc2
7
+ data.tar.gz: 04caac74a80c234131b862b78dbc0678deefa765a2816aafc4fb57bcbd063487a88a34265d774c1c5d8d8b9d08ee7feee00f6bb747082c2bbadaaa85bd66b252
data/README.md CHANGED
@@ -23,12 +23,15 @@ It looks as follows:
23
23
  tools:
24
24
  <tool base command>:
25
25
  enabled: true
26
- parameters: './...'
26
+ parameters: '-v'
27
+ blacklisted_files: '.*\/vendor\/.*'
27
28
  ```
28
29
 
29
- If a tool is not listed here, it will automatically be enabled with the parameters `./...`.
30
+ If a tool is not listed here, it will automatically be enabled.
30
31
  In order to specifically disable a tool, it has to be listed and `enabled` has to be set to `false`.
31
32
  If either of the keys is not provided the default will be assumed.
33
+ It is possible to pass specific parameters to the tool, which is executed with `<tool> <parameters> <file_path>`.
34
+ If is also possible to skip handling specific files by providing a pattern in `blacklisted_files`, e.g. `'.*\/vendor\/.*'` to ignore vendor. It will check every file by default.
32
35
 
33
36
  ## Implementing additional tools
34
37
 
data/lib/pronto/golang.rb CHANGED
@@ -34,6 +34,12 @@ module Pronto
34
34
  messages = []
35
35
 
36
36
  available_tools.each do |tool|
37
+ # Skip the patch if the filepath is blacklisted in the 'blacklisted_files' config
38
+ # Note: this defaults to '.*' and therefore matches everything by default
39
+ if tool.blacklisted_files_regexp.match?(escaped_path)
40
+ next
41
+ end
42
+
37
43
  Open3.popen3("#{tool.command(escaped_path)}") do |stdin, stdout, stderr, wait_thr|
38
44
  [stdout, stderr].each do |result_text|
39
45
  while output_line = result_text.gets
@@ -43,8 +49,6 @@ module Pronto
43
49
  end
44
50
  end
45
51
 
46
-
47
-
48
52
  while output_line = stderr.gets
49
53
  process_line(patch, tool, output_line)
50
54
  end
@@ -21,6 +21,10 @@ module Pronto
21
21
  @config.fetch('parameters', '') # Default to '' if the key is not configured
22
22
  end
23
23
 
24
+ def blacklisted_files_regexp
25
+ @regexp ||= Regexp.new(@config.fetch('blacklisted_files', '^(?!.*)$'))
26
+ end
27
+
24
28
  def available?
25
29
  installed? && enabled?
26
30
  end
@@ -1,5 +1,5 @@
1
1
  module Pronto
2
2
  module GolangVersion
3
- VERSION = '0.0.11'.freeze
3
+ VERSION = '0.0.12'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pronto-golang
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Schoknecht
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-13 00:00:00.000000000 Z
11
+ date: 2019-09-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pronto