Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/issues/datasetIssues.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { default as ignore } from '@ignore'
import type { Ignore } from '@ignore'
import { nonSchemaIssues } from './list.ts'
import type { Issue, IssueDefinition, IssueFile, Severity } from '../types/issues.ts'
export type { Issue, IssueDefinition, IssueFile, Severity }
Expand Down Expand Up @@ -41,7 +43,13 @@ export class DatasetIssues {
if (!value) {
continue
}
found = found.filter((x) => x[key as keyof Issue] === value)
if (key === 'location' && typeof value === "string" && !value.startsWith('/')){
// @ts-expect-error
const key_ignore = ignore().add(value as string)
found = found.filter((x) => x[key] && key_ignore.ignores(x[key].slice(1, x[key].length)))
} else {
found = found.filter((x) => x[key as keyof Issue] === value)
}
}
return found
}
Expand Down
3 changes: 2 additions & 1 deletion src/validators/filenameIdentify.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Deno.test('test hasMatch', async (t) => {
const parts = tmpFile.split('/')
const file = new BIDSFileDeno(
parts.slice(0, parts.length - 1).join('/'),
parts[parts.length - 1],
'/' + parts[parts.length - 1],
ignore,
)

Expand All @@ -82,6 +82,7 @@ Deno.test('test hasMatch', async (t) => {
code: 'NOT_INCLUDED',
}).length,
1,
`${context.file.path} ${tmpFile}`
)
Deno.removeSync(tmpFile)
})
Expand Down
Loading