Skip to content

Commit 00e6544

Browse files
committed
docs: release v1.9.0
1 parent 852c987 commit 00e6544

File tree

7 files changed

+48
-69
lines changed

7 files changed

+48
-69
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Common Changelog](https://common-changelog.org/), and this project adheres to
66
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
[1.9.0]: https://github.com/sablier-labs/devkit/releases/tag/v1.9.0
89
[1.8.1]: https://github.com/sablier-labs/devkit/releases/tag/v1.8.1
910
[1.8.0]: https://github.com/sablier-labs/devkit/releases/tag/v1.8.0
1011
[1.7.0]: https://github.com/sablier-labs/devkit/releases/tag/v1.7.0
@@ -31,6 +32,12 @@ The format is based on [Common Changelog](https://common-changelog.org/), and th
3132
[1.1.0]: https://github.com/sablier-labs/devkit/releases/tag/v1.1.0
3233
[1.0.0]: https://github.com/sablier-labs/devkit/releases/tag/v1.0.0
3334

35+
## [1.9.0] - 2025-12-16
36+
37+
### Changed
38+
39+
- Refactored CSV/TSV validation recipes to use extension-agnostic glob patterns, appending the extension at runtime
40+
3441
## [1.8.1] - 2025-12-16
3542

3643
### Fixed

just/csv.just

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import "./settings.just"
66

77
# Check CSV/TSV files using qsv: https://github.com/dathere/qsv
88
[group("checks"), script("python3")]
9-
_csv-check globs="data/*/*" ext="csv" schema="" ignore="*.csv.invalid|*.csv.valid|*validation-errors.csv":
9+
_csv-check glob="data/*/*.{csv,tsv}" schema="" ignore="*.invalid *.valid *validation-errors.*":
1010
import fnmatch
1111
import glob as globmod
1212
import subprocess
@@ -18,19 +18,18 @@ _csv-check globs="data/*/*" ext="csv" schema="" ignore="*.csv.invalid|*.csv.vali
1818
print("Install it: https://github.com/dathere/qsv")
1919
sys.exit(1)
2020

21-
ext = "{{ ext }}" or "csv"
22-
ignore_patterns = "{{ ignore }}".split("|") if "{{ ignore }}" else []
21+
ignore_patterns = "{{ ignore }}".split() if "{{ ignore }}" else []
2322
schema = "{{ schema }}" or None
24-
globs = "{{ globs }}.{{ ext }}"
23+
globs = "{{ glob }}"
2524

26-
print(f"Validating {ext} files...")
25+
print(f"Validating CSV/TSV files...")
2726
files = globmod.glob(globs)
2827

2928
# Filter ignored files
3029
files = [f for f in files if not any(fnmatch.fnmatch(f, p) for p in ignore_patterns)]
3130

3231
if not files:
33-
print(f"ℹ️ No {ext} files found to validate")
32+
print(f"ℹ️ No CSV/TSV files found to validate")
3433
sys.exit(0)
3534

3635
for file in files:
@@ -40,14 +39,14 @@ _csv-check globs="data/*/*" ext="csv" schema="" ignore="*.csv.invalid|*.csv.vali
4039
result = subprocess.run(cmd, capture_output=True)
4140
if result.returncode != 0:
4241
print(f"❌ Validation failed for: {file}")
43-
subprocess.run(["just", "_csv-show-errors", file, ext])
42+
subprocess.run(["just", "_csv-show-errors", file])
4443
sys.exit(1)
4544

46-
print(f"✅ All {ext} files are valid")
45+
print(f"✅ All CSV/TSV files are valid")
4746

4847
# Show validation errors for a CSV/TSV file
4948
[group("checks"), script("python3")]
50-
_csv-show-errors file ext="csv":
49+
_csv-show-errors file:
5150
import os
5251
import subprocess
5352
import sys

just/tsv.just

Lines changed: 0 additions & 15 deletions
This file was deleted.

justfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import "./just/base.just"
2-
import "./just/tsv.just"
2+
import "./just/csv.just"
33

44
# ---------------------------------------------------------------------------- #
55
# DEPENDENCIES #

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "Configuration files and reusable scripts for Sablier repositories",
44
"license": "MIT",
55
"type": "module",
6-
"version": "1.8.1",
6+
"version": "1.9.0",
77
"author": {
88
"name": "Sablier Labs Ltd",
99
"url": "https://sablier.com"

tests/csv.bats

Lines changed: 19 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ refute_output() {
6868
@test "validates a valid CSV file successfully" {
6969
check_qsv
7070

71-
run just _csv-check "tests/fixtures/valid" "csv"
71+
run just _csv-check "tests/fixtures/valid.csv"
7272

7373
assert_success
74-
assert_output --partial "Validating csv files..."
75-
assert_output --partial "✅ All csv files are valid"
74+
assert_output --partial "Validating CSV/TSV files..."
75+
assert_output --partial "✅ All CSV/TSV files are valid"
7676
}
7777

7878
@test "fails on invalid CSV file" {
@@ -87,8 +87,7 @@ id,name,age,email
8787
3,Charlie,35
8888
EOF
8989

90-
# Pass glob without extension - ext param will add .csv
91-
run just _csv-check "${TEST_TEMP_DIR}/invalid" "csv"
90+
run just _csv-check "${TEST_TEMP_DIR}/invalid.csv"
9291

9392
assert_failure
9493
assert_output --partial "❌ Validation failed for: ${temp_invalid}"
@@ -103,21 +102,19 @@ EOF
103102
cp tests/fixtures/valid.csv "$temp_valid1"
104103
cp tests/fixtures/valid.csv "$temp_valid2"
105104

106-
# Pass glob without extension - ext param will add .csv
107-
run just _csv-check "${TEST_TEMP_DIR}/*" "csv"
105+
run just _csv-check "${TEST_TEMP_DIR}/*.csv"
108106

109107
assert_success
110-
assert_output --partial "✅ All csv files are valid"
108+
assert_output --partial "✅ All CSV/TSV files are valid"
111109
}
112110

113111
@test "skips default ignore patterns (.csv.invalid)" {
114112
check_qsv
115113

116-
# Pass glob without extension - ext param will add .csv
117-
run just _csv-check "tests/fixtures/*" "csv"
114+
run just _csv-check "tests/fixtures/*.csv"
118115

119116
assert_success
120-
assert_output --partial "✅ All csv files are valid"
117+
assert_output --partial "✅ All CSV/TSV files are valid"
121118
}
122119

123120
@test "skips default ignore patterns (.csv.valid)" {
@@ -127,7 +124,7 @@ EOF
127124
cp tests/fixtures/valid.csv tests/fixtures/test.csv.valid
128125

129126
# The glob tests/fixtures/*.csv won't match .csv.valid files
130-
run just _csv-check "tests/fixtures/*" "csv"
127+
run just _csv-check "tests/fixtures/*.csv"
131128

132129
assert_success
133130
refute_output --partial "test.csv.valid"
@@ -142,7 +139,7 @@ EOF
142139
cp tests/fixtures/valid.csv tests/fixtures/test.validation-errors.csv
143140

144141
# The ignore pattern *validation-errors.csv should filter this out
145-
run just _csv-check "tests/fixtures/*" "csv"
142+
run just _csv-check "tests/fixtures/*.csv"
146143

147144
assert_success
148145
refute_output --partial "validation-errors.csv"
@@ -154,8 +151,7 @@ EOF
154151
check_qsv
155152

156153
# Test with custom ignore pattern that includes custom-ignore.csv
157-
# Order: globs, ext, schema, ignore
158-
run just _csv-check "tests/fixtures/*" "csv" "" "*custom-ignore.csv"
154+
run just _csv-check "tests/fixtures/*.csv" "" "*custom-ignore.csv"
159155

160156
assert_success
161157
refute_output --partial "custom-ignore.csv"
@@ -164,11 +160,10 @@ EOF
164160
@test "handles no files found gracefully" {
165161
check_qsv
166162

167-
# Pass glob without extension - ext param will add .csv
168-
run just _csv-check "tests/fixtures/nonexistent*" "csv"
163+
run just _csv-check "tests/fixtures/nonexistent*.csv"
169164

170165
assert_success
171-
assert_output --partial "ℹ️ No csv files found to validate"
166+
assert_output --partial "ℹ️ No CSV/TSV files found to validate"
172167
}
173168

174169
@test "validates with schema when provided" {
@@ -189,8 +184,7 @@ EOF
189184
EOF
190185

191186
# Note: This test may skip if qsv doesn't support JSON schema validation
192-
# Order: globs, ext, schema, ignore
193-
run just _csv-check "tests/fixtures/valid" "csv" "$schema_file"
187+
run just _csv-check "tests/fixtures/valid.csv" "$schema_file"
194188

195189
# Accept both success (validation passed) or specific qsv schema errors
196190
# The schema validation in qsv might work differently
@@ -200,21 +194,19 @@ EOF
200194
@test "passes empty schema parameter correctly" {
201195
check_qsv
202196

203-
run just _csv-check "tests/fixtures/valid" "csv"
197+
run just _csv-check "tests/fixtures/valid.csv"
204198

205199
assert_success
206200
}
207201

208202
@test "uses custom extension label" {
209203
check_qsv
210204

211-
# Order: globs, ext, schema, ignore
212-
# Using csv extension with CUSTOM label to test the label display
213-
run just _csv-check "tests/fixtures/valid" "csv"
205+
run just _csv-check "tests/fixtures/valid.csv"
214206

215207
assert_success
216-
assert_output --partial "Validating csv files..."
217-
assert_output --partial "✅ All csv files are valid"
208+
assert_output --partial "Validating CSV/TSV files..."
209+
assert_output --partial "✅ All CSV/TSV files are valid"
218210
}
219211

220212
# ---------------------------------------------------------------------------
@@ -258,8 +250,7 @@ EOF
258250
EOF
259251

260252
# Validate with schema (this should create the error file)
261-
# Order: globs, ext, schema, ignore
262-
run just _csv-check "${TEST_TEMP_DIR}/invalid_schema" "csv" "$schema_file"
253+
run just _csv-check "${TEST_TEMP_DIR}/invalid_schema.csv" "$schema_file"
263254

264255
# The error file should now exist
265256
[ -f "${temp_invalid}.validation-errors.tsv" ]

tests/tsv.bats

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -48,21 +48,20 @@ assert_output() {
4848
}
4949

5050
# ---------------------------------------------------------------------------
51-
# Tests for _tsv-check wrapper
51+
# Tests for TSV validation via _csv-check
5252
# ---------------------------------------------------------------------------
5353

54-
@test "TSV wrapper validates valid TSV file" {
54+
@test "TSV validation validates valid TSV file" {
5555
check_qsv
5656

57-
# Pass glob without extension - ext param will add .tsv
58-
run just _tsv-check "tests/fixtures/valid"
57+
run just _csv-check "tests/fixtures/valid.tsv"
5958

6059
assert_success
61-
assert_output --partial "Validating tsv files..."
62-
assert_output --partial "✅ All tsv files are valid"
60+
assert_output --partial "Validating CSV/TSV files..."
61+
assert_output --partial "✅ All CSV/TSV files are valid"
6362
}
6463

65-
@test "TSV wrapper fails on invalid TSV file" {
64+
@test "TSV validation fails on invalid TSV file" {
6665
check_qsv
6766

6867
local temp_invalid="${TEST_TEMP_DIR}/invalid.tsv"
@@ -72,31 +71,29 @@ id name age email
7271
2 Bob extra column here [email protected]
7372
EOF
7473

75-
# Pass glob without extension - ext param will add .tsv
76-
run just _tsv-check "${TEST_TEMP_DIR}/invalid"
74+
run just _csv-check "${TEST_TEMP_DIR}/invalid.tsv"
7775

7876
assert_failure
7977
assert_output --partial "❌ Validation failed for:"
8078
}
8179

82-
@test "TSV wrapper handles no files gracefully" {
80+
@test "TSV validation handles no files gracefully" {
8381
check_qsv
8482

85-
# Pass glob without extension - ext param will add .tsv
86-
run just _tsv-check "tests/fixtures/nonexistent*"
83+
run just _csv-check "tests/fixtures/nonexistent*.tsv"
8784

8885
assert_success
89-
assert_output --partial "ℹ️ No tsv files found to validate"
86+
assert_output --partial "ℹ️ No CSV/TSV files found to validate"
9087
}
9188

9289
# ---------------------------------------------------------------------------
93-
# Tests for _tsv-show-errors wrapper
90+
# Tests for _csv-show-errors with TSV files
9491
# ---------------------------------------------------------------------------
9592

9693
@test "TSV show-errors displays error file not found" {
9794
check_qsv
9895

99-
run just _tsv-show-errors "tests/fixtures/nonexistent.tsv"
96+
run just _csv-show-errors "tests/fixtures/nonexistent.tsv"
10097

10198
assert_success
10299
assert_output --partial "Error file not found:"

0 commit comments

Comments
 (0)