judgelint 0.1.6-aarch64-linux → 0.1.7-aarch64-linux

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: 47c0745b84d8a2872b457edaeb36eeeef5e67af490ed00e587b774546a77627f
4
- data.tar.gz: 610e2de9cc05013b1d67fd9fd696eb1603755a2768ef81a94936059615e03992
3
+ metadata.gz: 27961d6e4a1e8329a123cee50be37cd5657c727d1c8babf8e09ec86049044d58
4
+ data.tar.gz: ec33d19a4acc734ad7ab1c766e2275d771d7c2ca29931b35a188bffc5ca08d42
5
5
  SHA512:
6
- metadata.gz: '028d2c53af57dcd2faaf18061b6dc2df973e810ca3c9bb4a54c87116fe897294b9f570f517819c894f59f8f48f6a478a26229a9d6a3925e52bebf38d40a76f6e'
7
- data.tar.gz: 7964fc3786e4bab686e680841548a7df97dd8e99a9853e7a9069564c6299be30662ef4658ddc31dbe4f6c4bb6a41c044d1cf0c0eee09e5a52a56c20873f86004
6
+ metadata.gz: 6e4be169bc91730c1bd868bd9fe3645e36b592e7f4335502860e20cfc80106355d2dd8c8e119050b64cec6cb759db309f9f0c0d003ed051a69681484014e7587
7
+ data.tar.gz: 4faf11c5e4ce0319a87560ccd50d19349b00992c588ebd8c9074f9d2b4e1430327546d269d98070d9c0d06ae3cac5ca5898976440beb98adfbb049ff8c6e9929
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.7 (2026-10-26)
4
+
5
+ - A symlink that points to itself no longer crashes a run. Ruby's Dir.glob
6
+ raised ELOOP when a pattern looked inside one; judgelint now skips it.
7
+
3
8
  ## 0.1.6 (2026-10-26)
4
9
 
5
10
  - `--base` and `--pr` ask about the changed lines, not the 40-line windows
@@ -14,7 +14,27 @@ module Judgelint
14
14
  end
15
15
 
16
16
  def self.expand(patterns)
17
- patterns.flat_map { |pattern| Dir.glob(pattern) }.select { |path| File.file?(path) }.uniq.sort
17
+ patterns.flat_map { |pattern| glob(pattern) }.select { |path| File.file?(path) }.uniq.sort
18
+ end
19
+
20
+ # Dir.glob, except that a symlink to itself is skipped. Dir.glob raises
21
+ # ELOOP when a pattern looks inside one, so the pattern is then globbed a
22
+ # segment at a time, entering only directories that resolve.
23
+ def self.glob(pattern)
24
+ Dir.glob(pattern)
25
+ rescue Errno::ELOOP
26
+ parts = pattern.split("/")
27
+ found = [""]
28
+ until parts.empty?
29
+ part = parts.shift
30
+ part = "#{part}/#{parts.shift}" if part == "**" && !parts.empty?
31
+ found = found.flat_map do |dir|
32
+ next [] unless dir.empty? || File.directory?(dir)
33
+
34
+ Dir.glob(dir.empty? ? part : File.join(dir, part))
35
+ end
36
+ end
37
+ found
18
38
  end
19
39
 
20
40
  # The files to check: in a git repository, those git tracks or would add,
@@ -89,7 +89,7 @@ module Judgelint
89
89
 
90
90
  # The directories a directory rule governs.
91
91
  def directories
92
- paths.flat_map { |pattern| Dir.glob(pattern) }.select { |path| File.directory?(path) && applies_to?(path) }.uniq.sort
92
+ paths.flat_map { |pattern| Glob.glob(pattern) }.select { |path| File.directory?(path) && applies_to?(path) }.uniq.sort
93
93
  end
94
94
 
95
95
  # The ranges to ask about: windows of +size+ lines, or the whole file.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Judgelint
4
- VERSION = "0.1.6"
4
+ VERSION = "0.1.7"
5
5
  end
data/libexec/judgelint CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: judgelint
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: aarch64-linux
6
6
  authors:
7
7
  - JP Camara