Skip to content

Commit 38c84ec

Browse files
committed
config glob patterns not prefixed with slash, fix tests that mistakenly created a file not starting with slash
1 parent 36c231c commit 38c84ec

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/issues/datasetIssues.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export class DatasetIssues {
4343
if (!value) {
4444
continue
4545
}
46-
if (key === 'location'){
46+
if (key === 'location' && typeof value === "string" && !value.startsWith('/')){
4747
// @ts-expect-error
4848
const key_ignore = ignore().add(value as string)
4949
found = found.filter((x) => x[key] && key_ignore.ignores(x[key].slice(1, x[key].length)))

src/validators/filenameIdentify.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Deno.test('test hasMatch', async (t) => {
7070
const parts = tmpFile.split('/')
7171
const file = new BIDSFileDeno(
7272
parts.slice(0, parts.length - 1).join('/'),
73-
parts[parts.length - 1],
73+
'/' + parts[parts.length - 1],
7474
ignore,
7575
)
7676

@@ -82,6 +82,7 @@ Deno.test('test hasMatch', async (t) => {
8282
code: 'NOT_INCLUDED',
8383
}).length,
8484
1,
85+
`${context.file.path} ${tmpFile}`
8586
)
8687
Deno.removeSync(tmpFile)
8788
})

0 commit comments

Comments
 (0)