Skip to content

Commit 53e81c8

Browse files
authored
Merge pull request #247 from effigies/feat/tsv_type_errors
feat: Always error on incorrect TSV types
2 parents fd3da41 + dd8a88b commit 53e81c8

File tree

5 files changed

+51
-9
lines changed

5 files changed

+51
-9
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<!--
2+
A new scriv changelog fragment.
3+
4+
Uncomment the section that is right (remove the HTML comment wrapper).
5+
For top level release notes, leave all the headers commented out.
6+
-->
7+
<!--
8+
### Added
9+
10+
- A bullet item for the Added category.
11+
12+
-->
13+
### Changed
14+
15+
- Raise errors for all TSV type check failures.
16+
Previously, recommended and optional fields would raise warnings.
17+
18+
<!--
19+
### Fixed
20+
21+
- A bullet item for the Fixed category.
22+
23+
-->
24+
<!--
25+
### Deprecated
26+
27+
- A bullet item for the Deprecated category.
28+
29+
-->
30+
<!--
31+
### Removed
32+
33+
- A bullet item for the Removed category.
34+
35+
-->
36+
<!--
37+
### Security
38+
39+
- A bullet item for the Security category.
40+
41+
-->
42+
<!--
43+
### Infrastructure
44+
45+
- A bullet item for the Infrastructure category.
46+
47+
-->

src/issues/list.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,6 @@ export const bidsIssues: IssueDefinitionRecord = {
123123
reason:
124124
'A value in a column did not match the acceptable type for that column headers specified format.',
125125
},
126-
TSV_VALUE_INCORRECT_TYPE_NONREQUIRED: {
127-
severity: 'warning',
128-
reason:
129-
'A value in a column did not match the acceptable type for that column headers specified format.',
130-
},
131126
TSV_COLUMN_TYPE_REDEFINED: {
132127
severity: 'warning',
133128
reason:

src/schema/tables.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Deno.test('tables eval* tests', async (t) => {
6969
const rule = schemaDefs.rules.tabular_data.modality_agnostic.Scans
7070
evalColumns(rule, context, schema, 'rules.tabular_data.modality_agnostic.Scans')
7171
assertEquals(
72-
context.dataset.issues.get({ code: 'TSV_VALUE_INCORRECT_TYPE_NONREQUIRED' }).length,
72+
context.dataset.issues.get({ code: 'TSV_VALUE_INCORRECT_TYPE' }).length,
7373
1,
7474
)
7575
})
@@ -159,7 +159,7 @@ Deno.test('tables eval* tests', async (t) => {
159159

160160
// Overriding the default sex definition uses the provided values
161161
// Values in the default definition may raise issues
162-
issues = context.dataset.issues.get({ code: 'TSV_VALUE_INCORRECT_TYPE_NONREQUIRED' })
162+
issues = context.dataset.issues.get({ code: 'TSV_VALUE_INCORRECT_TYPE' })
163163
assertEquals(issues.length, 1)
164164
assertEquals(issues[0].subCode, 'sex')
165165
assertEquals(issues[0].line, 4)

src/schema/tables.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ export function evalColumns(
251251
const spec = compileSignature(signature, schema.objects.formats)
252252

253253
const issue = {
254-
code: 'TSV_VALUE_INCORRECT_TYPE' + (requirement != 'required' ? '_NONREQUIRED' : ''),
254+
code: 'TSV_VALUE_INCORRECT_TYPE',
255255
subCode: name,
256256
location: context.path,
257257
rule: schemaPath,

0 commit comments

Comments
 (0)