pronto-golang 0.0.11 → 0.0.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -2
- data/lib/pronto/golang.rb +6 -2
- data/lib/pronto/golang/tools/base.rb +4 -0
- data/lib/pronto/golang/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aef845e2e4afb8599a35044ce4a59a07443dc4d405128dc33c093ee084932a0e
|
4
|
+
data.tar.gz: c2a3e0095846f6fb6b6c76710e98df3397deed37ada5c674935eeac7d262b54c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
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.
|
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-
|
11
|
+
date: 2019-09-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pronto
|