Skip to content

Commit 9e52cfe

Browse files
authored
Merge pull request #40 from bcdev/forman-39-fix_scanning_urls
Fix scanning URLs
2 parents 2536ea0 + c5932da commit 9e52cfe

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

CHANGES.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# XRLint Change History
22

3+
## Version 0.4.1 (in development)
4+
5+
- Fixed an issue that prevented recursively traversing folders referred
6+
to by URLs (such as `s3://<bucket>/<path>/`) rather than local directory
7+
paths. (#39)
8+
39
## Version 0.4.0 (from 2025-01-27)
410

511
- Fixed and enhanced core rule `time-coordinate`. `(#33)

xrlint/cli/engine.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ def compute_config(p: str):
175175
for file_path in file_paths:
176176
_fs, root = fsspec.url_to_fs(file_path)
177177
fs: fsspec.AbstractFileSystem = _fs
178+
is_local = isinstance(fs, fsspec.implementations.local.LocalFileSystem)
178179

179180
config = compute_config(file_path)
180181
if config is not None:
@@ -185,13 +186,15 @@ def compute_config(p: str):
185186
for path, dirs, files in fs.walk(root, topdown=True):
186187
for d in list(dirs):
187188
d_path = f"{path}/{d}"
189+
d_path = d_path if is_local else fs.unstrip_protocol(d_path)
188190
c = compute_config(d_path)
189191
if c is not None:
190192
dirs.remove(d)
191193
yield d_path, c
192194

193195
for f in files:
194196
f_path = f"{path}/{f}"
197+
f_path = f_path if is_local else fs.unstrip_protocol(f_path)
195198
c = compute_config(f_path)
196199
if c is not None:
197200
yield f_path, c

xrlint/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version = "0.4.0"
1+
version = "0.4.1.dev0"

0 commit comments

Comments
 (0)