gergich 1.1.1 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +0 -1
- data/bin/run_tests.sh +8 -38
- data/lib/gergich/capture/androidlint_capture.rb +2 -2
- data/lib/gergich/capture/swiftlint_capture.rb +2 -2
- data/lib/gergich/cli/gergich.rb +1 -1
- data/spec/gergich/capture/androidlint_capture_spec.rb +4 -4
- data/spec/gergich/capture/swiftlint_capture_spec.rb +2 -2
- metadata +14 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e58c68d37d5edc2b490942f01486e732dbe9dc65
|
4
|
+
data.tar.gz: f7adcb070fa5a7cb343d89c8ac3209a1dcb66fa5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf13893fd3b0f17fba6e14a191b8ee0722605a657801013b275ff9c5aa8035050d0dc8515d8af6b94f43cd6da42f369673f17a5d54a3df214524ba9e655e1ccc
|
7
|
+
data.tar.gz: dec0877120594b960d2d447025d6ec11fb4ae6cb74027fea8318872855b87c18b26f4883a0c48df1a9e670c3408c31c76536f2a9d4228d6f54ebec711dc74cec
|
data/README.md
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
# Gergich
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/gergich.svg)](https://rubygems.org/gems/gergich)
|
4
|
-
[![Dependency Status](https://gemnasium.com/badges/a2946a7849cd94f5ec0f4c3173a968f4.svg)](https://gemnasium.com/cc6fb44edee9fcf855cec82d3b6aed0f)
|
5
4
|
[![Build Status](https://travis-ci.org/instructure/gergich.svg?branch=master)](https://travis-ci.org/instructure/gergich)
|
6
5
|
|
7
6
|
Gergich is a command-line tool (and ruby lib) for easily posting comments
|
data/bin/run_tests.sh
CHANGED
@@ -2,51 +2,21 @@
|
|
2
2
|
|
3
3
|
set -e
|
4
4
|
|
5
|
-
|
6
|
-
echo -e "\n[$@] STARTING $(date)"
|
7
|
-
last_status=0
|
8
|
-
"$@" || last_status=$?
|
9
|
-
if [[ $last_status == 0 ]]; then
|
10
|
-
echo -e "[$@] \033[32mOK\033[0m"
|
11
|
-
else
|
12
|
-
echo -e "[$@] \033[31mFAILED!\033[0m"
|
13
|
-
fi
|
14
|
-
echo -e "[$@] FINISHED $(date)\n"
|
5
|
+
bundle exec rubocop --fail-level autocorrect
|
15
6
|
|
16
|
-
|
17
|
-
}
|
7
|
+
ruby -v | egrep "^ruby 2\.4" && export COVERAGE=1
|
18
8
|
|
19
|
-
|
20
|
-
end_timestamp=$(date +%s)
|
21
|
-
duration=$((end_timestamp-start_timestamp))
|
22
|
-
|
23
|
-
if [[ $last_status != 0 ]]; then
|
24
|
-
echo -e "\033[31mBUILD FAILED\033[0m in $duration seconds\n"
|
25
|
-
else
|
26
|
-
echo "BUILD PASSED in $duration seconds"
|
27
|
-
fi
|
28
|
-
exit $last_status
|
29
|
-
}
|
30
|
-
|
31
|
-
start_timestamp=$(date +%s)
|
32
|
-
|
33
|
-
run_command bundle exec rubocop
|
34
|
-
|
35
|
-
export COVERAGE=1
|
36
|
-
|
37
|
-
run_command bundle exec rspec
|
9
|
+
bundle exec rspec
|
38
10
|
|
39
11
|
# these actually hit gerrit; only run them in CI land (you can do it
|
40
12
|
# locally if you set all the docker-compose env vars)
|
41
13
|
if [[ "$GERRIT_PATCHSET_REVISION" ]]; then
|
42
|
-
|
43
|
-
|
44
|
-
DRY_RUN=1
|
14
|
+
bundle exec bin/gergich citest
|
15
|
+
bundle exec bin/master_bouncer check
|
16
|
+
DRY_RUN=1 bundle exec bin/master_bouncer check_all
|
45
17
|
# ensure gergich works without .git directories
|
46
18
|
rm -rf .git
|
47
|
-
|
19
|
+
bundle exec bin/gergich status
|
48
20
|
fi
|
49
21
|
|
50
|
-
|
51
|
-
|
52
|
-
clean_up_and_exit
|
22
|
+
bundle exec bin/check_coverage
|
@@ -11,7 +11,7 @@ module Gergich
|
|
11
11
|
}.freeze
|
12
12
|
|
13
13
|
def run(output)
|
14
|
-
# rubocop:disable
|
14
|
+
# rubocop:disable Layout/LineLength
|
15
15
|
#
|
16
16
|
# Example:
|
17
17
|
# /path/to/some.xml:27: Warning: Consider adding android:drawableStart="@drawable/a_media" to better support right-to-left layouts [RtlHardcoded]
|
@@ -26,7 +26,7 @@ module Gergich
|
|
26
26
|
# <plurals name="number">
|
27
27
|
# ^
|
28
28
|
#
|
29
|
-
# rubocop:enable
|
29
|
+
# rubocop:enable Layout/LineLength
|
30
30
|
pattern = /
|
31
31
|
^([^:\n]+):(\d+)?:?\s(\w+):\s(.*?)\n
|
32
32
|
([^\n]+\n
|
@@ -12,13 +12,13 @@ module Gergich
|
|
12
12
|
}.freeze
|
13
13
|
|
14
14
|
def run(output)
|
15
|
-
# rubocop:disable
|
15
|
+
# rubocop:disable Layout/LineLength
|
16
16
|
#
|
17
17
|
# Example:
|
18
18
|
# /path/to/My.swift:13:22: warning: Colon Violation: Colons should be next to the identifier when specifying a type. (colon)
|
19
19
|
# /path/to/Fail.swift:80: warning: Line Length Violation: Line should be 100 characters or less: currently 108 characters (line_length)
|
20
20
|
#
|
21
|
-
# rubocop:enable
|
21
|
+
# rubocop:enable Layout/LineLength
|
22
22
|
pattern = /
|
23
23
|
^([^:\n]+):(\d+)(?::\d+)?:\s(\w+):\s(.*?)\n
|
24
24
|
/mx
|
data/lib/gergich/cli/gergich.rb
CHANGED
@@ -14,7 +14,7 @@ CI_TEST_ARGS = {
|
|
14
14
|
],
|
15
15
|
"label" => ["Code-Review", 1],
|
16
16
|
"message" => ["this is a test"],
|
17
|
-
"capture" => ["rubocop", "echo
|
17
|
+
"capture" => ["rubocop", format("echo %<output>s", output: Shellwords.escape(<<~OUTPUT))]
|
18
18
|
bin/gergich:47:8: C: Prefer double-quoted strings
|
19
19
|
if ENV['DEBUG']
|
20
20
|
^^^^^^^
|
@@ -3,12 +3,12 @@
|
|
3
3
|
require_relative "../../support/capture_shared_examples"
|
4
4
|
|
5
5
|
RSpec.describe Gergich::Capture::AndroidlintCapture do
|
6
|
-
# rubocop:disable
|
6
|
+
# rubocop:disable Layout/LineLength
|
7
7
|
let(:rtl_hardcoded) { 'Consider adding android:drawableStart="@drawable/a_media" to better support right-to-left layouts [RtlHardcoded]' }
|
8
8
|
let(:rtl_enabled) { "The project references RTL attributes, but does not explicitly enable or disable RTL support with android:supportsRtl in the manifest [RtlEnabled]" }
|
9
9
|
let(:lint_error) { 'No .class files were found in project "0.0.2", so none of the classfile based checks could be run. Does the project need to be built first? [LintError]' }
|
10
10
|
let(:unused_quantity) { 'For language "fr" (French) the following quantities are not relevant: few, zero [UnusedQuantity]' }
|
11
|
-
# rubocop:enable
|
11
|
+
# rubocop:enable Layout/LineLength
|
12
12
|
let(:output) do
|
13
13
|
<<~OUTPUT
|
14
14
|
/path/to/some.xml:27: Warning: #{rtl_hardcoded}
|
@@ -31,9 +31,9 @@ RSpec.describe Gergich::Capture::AndroidlintCapture do
|
|
31
31
|
{
|
32
32
|
path: "/path/to/some.xml",
|
33
33
|
position: 27,
|
34
|
-
# rubocop:disable
|
34
|
+
# rubocop:disable Layout/LineLength
|
35
35
|
message: "[androidlint] #{rtl_hardcoded}\n\n android:drawableLeft=\"@drawable/ic_cv_media\"/>\n ~~~~~~~~~~~~~~~~~~~~",
|
36
|
-
# rubocop:enable
|
36
|
+
# rubocop:enable Layout/LineLength
|
37
37
|
severity: "warn"
|
38
38
|
},
|
39
39
|
{
|
@@ -3,11 +3,11 @@
|
|
3
3
|
require_relative "../../support/capture_shared_examples"
|
4
4
|
|
5
5
|
RSpec.describe Gergich::Capture::SwiftlintCapture do
|
6
|
-
# rubocop:disable
|
6
|
+
# rubocop:disable Layout/LineLength
|
7
7
|
let(:colon_violation) { "Colon Violation: Colons should be next to the identifier when specifying a type. (colon)" }
|
8
8
|
let(:line_length_violation) { "Line Length Violation: Line should be 100 characters or less: currently 129 characters (line_length)" }
|
9
9
|
let(:force_cast_violation) { "Force Cast Violation: Force casts should be avoided. (force_cast)" }
|
10
|
-
# rubocop:enable
|
10
|
+
# rubocop:enable Layout/LineLength
|
11
11
|
let(:output) do
|
12
12
|
<<~OUTPUT
|
13
13
|
/path/to/My.swift:13:22: warning: #{colon_violation}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gergich
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jon Jensen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-01-
|
11
|
+
date: 2020-01-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -16,84 +16,84 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0.
|
19
|
+
version: '0.17'
|
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: '0.
|
26
|
+
version: '0.17'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: sqlite3
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '1.
|
33
|
+
version: '1.4'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '1.
|
40
|
+
version: '1.4'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '13.0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '13.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rspec
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '3.
|
61
|
+
version: '3.9'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '3.
|
68
|
+
version: '3.9'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rubocop
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
75
|
+
version: 0.79.0
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
82
|
+
version: 0.79.0
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: simplecov
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: 0.
|
89
|
+
version: 0.17.1
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: 0.
|
96
|
+
version: 0.17.1
|
97
97
|
description: Gergich is a little command-line tool for wiring up linters to Gerrit
|
98
98
|
so you can get nice inline comments right on the review
|
99
99
|
email: jon@instructure.com
|