Skip to content

Commit

Permalink
supports lint setting in metaschema; marks some attrs as unconventional
Browse files Browse the repository at this point in the history
This commit introduces a notion of "lint" setting, which is to be used
to configure linting behavior for tools that can automatically
validate that conventions are being followed.

Also marks several historical attributes as behaving unconventionally,
specifically:

   - activity_id's sibling is called activity_name instead of activity
   - the enums for opcode_id and disk_level_id enum are based on
     external standards and hence do not follow the 0/99 convention

Signed-off-by: Donovan Kolbly <[email protected]>
  • Loading branch information
dkolbly committed Apr 24, 2024
1 parent 7b31e89 commit 0a30d79
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ Thankyou! -->
* Updated the GitHub workflow for the `ocsf-validator` to print colorized output.
2. Clarify how to reference profiles in metadata #1056
* Updated the description of `metadata.profiles` to clarify the correct way to reference a profile in that list.

3. Adds support for `lint` controls in attributes to allow tools to automatically validate conventions
* Updated several attributes that do not follow conventions to disable linting for them
* Updated `data_lifecycle_state_id` to add a 99(Other) enumerand to follow convention

## [v1.2.0] - April 23rd, 2024

Expand Down
5 changes: 4 additions & 1 deletion dictionary.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
}
},
"sibling": "activity_name",
"lint": ["no-sibling-convention"],
"type": "integer_t"
},
"activity_name": {
Expand Down Expand Up @@ -2688,6 +2689,7 @@
"description": "DNS Stateful Operations (DSO)"
}
},
"lint": ["no-enum-convention"],
"type": "integer_t"
},
"open_mask": {
Expand Down Expand Up @@ -3361,6 +3363,7 @@
"caption": "Critical"
}
},
"lint": ["no-enum-convention"],
"sibling": "risk_level",
"type": "integer_t"
},
Expand Down Expand Up @@ -4434,4 +4437,4 @@
}
}
}
}
}
2 changes: 1 addition & 1 deletion metaschema/attribute.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,4 @@
}
}
}
}
}
12 changes: 11 additions & 1 deletion metaschema/dictionary-attribute.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,19 @@
"type": "boolean",
"description": "A flag used when the attribute represents an array of values rather than a single value."
},
"lint": {
"type": "array",
"items": {
"type": "string",
"enum": [
"no-sibling-convention",
"no-enum-convention"
]
}
},
"observable": {
"$ref": "observable.schema.json"
}
},
"additionalProperties": false
}
}

0 comments on commit 0a30d79

Please sign in to comment.