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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c136f70693c4056dbb352a227193f29dbf5a89c9b41a506b7e74b8d1e2427b70
4
- data.tar.gz: 76b353a62e3cf05b35fb51ff7d0f4538ebba9e80e667422bd247de995486691e
3
+ metadata.gz: da039bd935c10929740c00d131d0a453c387affd2904c80cbfcf1fde225e7f52
4
+ data.tar.gz: afa835938ba088eefae80b66f756a9e87a28f83f1e790122f1c6abd017bb63ab
5
5
  SHA512:
6
- metadata.gz: 4620ad693fd1ffb80817470b538af39defad1846dcb0dd6c6f010d188ea3bb85d1ab0cc114b1bac3e7aa74c7751d866480be3ec9e13dd7804e402ef0142e93a8
7
- data.tar.gz: f6698991577d6b75dd1cf1715df35cc7a2a719adb64d4422320d7ecb020077211766d45d5fb4165bf64af311cbd043415c261c32cdd599ac702d3b24650a246d
6
+ metadata.gz: ba177ffef9a4c56702faa01053657fd184c9380206f32b0a5f6e401d836335c0df9d8aa9505fa55dbb147bf8cb1310e5fa2539cf9dcc9e5ed252fa787e185c8c
7
+ data.tar.gz: '080fe79013ccf40f99ca171412c4b8c78cfb6a75df61fa29ab098cee9edda90fc75b9f538edd948b91d5c0bbe7a86ef6b105dbf3974ce35677afa3e64dd3efec'
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Qualmzy
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.3"
5
5
  end
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.2
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: 2026-11-24 00:00:00.000000000 Z
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: 3.0.3.1
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: []