File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -133,6 +133,10 @@ export const bidsIssues: IssueDefinitionRecord = {
133133 reason :
134134 'A column required in a TSV file has been redefined in a sidecar file. This redefinition is being ignored.' ,
135135 } ,
136+ TSV_PSEUDO_AGE_DEPRECATED : {
137+ severity : 'warning' ,
138+ reason : 'Use of the value "89+" in column "age" is deprecated. Use 89 for all ages 89 and over.' ,
139+ } ,
136140 INVALID_GZIP : {
137141 severity : 'error' ,
138142 reason : 'The gzip file could not be decompressed. It may be corrupt or misnamed.' ,
Original file line number Diff line number Diff line change @@ -257,9 +257,23 @@ export function evalColumns(
257257 rule : schemaPath ,
258258 }
259259
260+ const ageCheck = name == 'age'
261+ let ageWarningIssued = false
262+
260263 const column = context . columns [ name ] as string [ ]
261264 for ( const [ index , value ] of column . entries ( ) ) {
262265 if ( ! checkValue ( value , spec ) ) {
266+ if ( ageCheck && value === '89+' ) {
267+ if ( ! ageWarningIssued ) {
268+ ageWarningIssued = true
269+ context . dataset . issues . add ( {
270+ code : 'TSV_PSEUDO_AGE_DEPRECATED' ,
271+ location : context . path ,
272+ line : index + 2 ,
273+ } )
274+ }
275+ continue
276+ }
263277 const issueMessage = `'${ value } '` +
264278 ( value . match ( / ^ \s * ( N A | n a | n a n | N a N | n \/ a ) \s * $ / ) ? ", did you mean 'n/a'?" : '' )
265279 context . dataset . issues . add ( {
You can’t perform that action at this time.
0 commit comments