qualmzy 0.1.2 → 0.1.3
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 +4 -4
- data/lib/qualmzy/git_diff.rb +4 -4
- data/lib/qualmzy/version.rb +1 -1
- metadata +3 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: da039bd935c10929740c00d131d0a453c387affd2904c80cbfcf1fde225e7f52
|
|
4
|
+
data.tar.gz: afa835938ba088eefae80b66f756a9e87a28f83f1e790122f1c6abd017bb63ab
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ba177ffef9a4c56702faa01053657fd184c9380206f32b0a5f6e401d836335c0df9d8aa9505fa55dbb147bf8cb1310e5fa2539cf9dcc9e5ed252fa787e185c8c
|
|
7
|
+
data.tar.gz: '080fe79013ccf40f99ca171412c4b8c78cfb6a75df61fa29ab098cee9edda90fc75b9f538edd948b91d5c0bbe7a86ef6b105dbf3974ce35677afa3e64dd3efec'
|
data/lib/qualmzy/git_diff.rb
CHANGED
|
@@ -47,9 +47,9 @@ module Qualmzy
|
|
|
47
47
|
args = [*PINNED, base, "--", change.path]
|
|
48
48
|
git(*args, allow: [1]).stdout
|
|
49
49
|
end
|
|
50
|
+
return Diff.new("", true, false) if raw.lines.any? { |line| line.start_with?("Binary files ") || line.start_with?("GIT binary patch") }
|
|
50
51
|
text = normalize(raw)
|
|
51
52
|
return Diff.new(text, false, false) unless text.empty?
|
|
52
|
-
return Diff.new("", true, false) if raw.lines.any? { |line| line.start_with?("Binary files ") || line.start_with?("GIT binary patch") }
|
|
53
53
|
return Diff.new("", false, true) if raw.empty? || raw.include?("similarity index 100%") || raw.match?(/^old mode /)
|
|
54
54
|
raise Error, "could not read diff for #{change.path}"
|
|
55
55
|
rescue Errno::ENOENT
|
|
@@ -118,14 +118,14 @@ module Qualmzy
|
|
|
118
118
|
File.exist?(File.join(@dir, path)) || git("cat-file", "-e", "#{base}:./#{path}", allow: [128]).success?
|
|
119
119
|
end
|
|
120
120
|
def normalize(raw)
|
|
121
|
-
raw.lines.reject { |line| line.start_with?("diff --git ", "index ", "--- ", "+++ ", "old mode ", "new mode ", "new file mode ", "deleted file mode ", "similarity index ", "rename from ", "rename to ") }.join
|
|
121
|
+
text = raw.lines.reject { |line| line.start_with?("diff --git ", "index ", "--- ", "+++ ", "old mode ", "new mode ", "new file mode ", "deleted file mode ", "similarity index ", "rename from ", "rename to ") }.join
|
|
122
|
+
text.force_encoding(Encoding::UTF_8).scrub { |bytes| bytes.bytes.map { |byte| format('\\x%02X', byte) }.join }
|
|
122
123
|
end
|
|
123
124
|
def unified_for_untracked(path, content)
|
|
125
|
+
return "Binary files /dev/null and b/#{path} differ\n" if content.include?("\0")
|
|
124
126
|
lines = content.force_encoding(Encoding::UTF_8).lines
|
|
125
127
|
return "" if lines.empty?
|
|
126
128
|
"@@ -0,0 +1,#{lines.length} @@\n" + lines.map { |line| "+#{line}" }.join
|
|
127
|
-
rescue Encoding::InvalidByteSequenceError
|
|
128
|
-
"Binary files /dev/null and b/#{path} differ\n"
|
|
129
129
|
end
|
|
130
130
|
end
|
|
131
131
|
end
|
data/lib/qualmzy/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: qualmzy
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- qualmzy contributors
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: exe
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies: []
|
|
13
12
|
description: 'Pure Ruby port of Qualm: judge changed files and fail when a reviewer
|
|
14
13
|
would ask for simplification.'
|
|
15
|
-
email:
|
|
16
14
|
executables:
|
|
17
15
|
- qualmzy
|
|
18
16
|
extensions: []
|
|
@@ -37,7 +35,6 @@ licenses:
|
|
|
37
35
|
- MIT
|
|
38
36
|
metadata:
|
|
39
37
|
source_code_uri: https://github.com/tools4imps/qualm
|
|
40
|
-
post_install_message:
|
|
41
38
|
rdoc_options: []
|
|
42
39
|
require_paths:
|
|
43
40
|
- lib
|
|
@@ -52,8 +49,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
52
49
|
- !ruby/object:Gem::Version
|
|
53
50
|
version: '0'
|
|
54
51
|
requirements: []
|
|
55
|
-
rubygems_version:
|
|
56
|
-
signing_key:
|
|
52
|
+
rubygems_version: 4.0.21
|
|
57
53
|
specification_version: 4
|
|
58
54
|
summary: A subjective pull-request gate powered by Jev
|
|
59
55
|
test_files: []
|