Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Associate findings with changes or with new unfixed array #25

Merged
merged 3 commits into from
Apr 9, 2024
Merged
Changes from all 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
61 changes: 39 additions & 22 deletions codetf.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@
"description": "The changes for a given codemod",
"items": { "$ref": "#/definitions/changeset" },
"minItems": 0
},
"unfixed": {
"type": "array",
"description": "A set of file paths for files that the tool failed to fix",
"items": { "$ref": "#/definitions/unfixedFinding" }
}
},
"required": ["codemod", "summary", "description", "changeset"]
Expand Down Expand Up @@ -177,6 +182,10 @@
"type": "array",
"description": "The package actions that were needed to support changes to the file",
"items": { "$ref": "#/definitions/packageAction" }
},
"finding": {
"$ref": "#/definitions/detector/fixedFinding",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still not sure whether this needs to be an array.

"description": "The finding that was fixed at this location"
}
},
"required": ["lineNumber", "diffSide"]
Expand Down Expand Up @@ -209,46 +218,54 @@
"name": {
"type": "string",
"description": "Name of the tool that detected the issue"
},
"rule": {
"$ref": "#/definitions/detector/rule",
"description": "The rule that detected the issue"
},
"findings": {
"type": "array",
"items": { "$ref": "#/definitions/detector/finding" },
"maxItems": 20
}
},
"additionalProperties": true,
"required": ["name", "rule", "findings"]
"required": ["name"]
},

"detector": {
"finding": {
"fixedFinding": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "A unique identifier for the finding (e.g. 'guid' from SARIF)"
},
"fixed": {
"type": "boolean",
"description": "Whether the finding was fixed by the codemod"
"rule": {
"$ref": "#/definitions/detector/rule",
"description": "The rule that detected the issue"
}
},
"additionalProperties": true,
"required": ["id", "rule"]
},
"unfixedFinding": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "A unique identifier for the finding (e.g. 'guid' from SARIF)"
},
"rule": {
"$ref": "#/definitions/detector/rule",
"description": "The rule that detected the issue"
},
"path": {
"type": "string",
"description": "The path of the file (relative to the directory) that was not fixed"
},
"lineNumber": {
"type": "integer",
"description": "The line number that was not fixed"
},
"reason": {
"type": "string",
"description": "Reason the finding was not fixed"
drdavella marked this conversation as resolved.
Show resolved Hide resolved
"description": "A human-readable description of the reason the file was not fixed"
}
},
"additionalProperties": true,
"required": ["id", "fixed"],
"if": {
"properties": {
"fixed": { "boolean": false }
},
"required": ["reason"]
}
"required": ["id", "rule", "path", "reason"]
},
"rule": {
"type": "object",
Expand Down