Skip to content

Describe Block Update Fix#21

Merged
em-c-rod merged 13 commits intomainfrom
describeBlockReturnFix
Mar 31, 2023
Merged

Describe Block Update Fix#21
em-c-rod merged 13 commits intomainfrom
describeBlockReturnFix

Conversation

@georgedias
Copy link
Contributor

@georgedias georgedias commented Mar 25, 2023

The getExistingDescribeFromControl return value needs to check if the last entry on the array is a blank line, it currently assumes that one exists, this causes invalid syntax being returned if there isn't a blank line at the end of the array

Update the return with the following code

return logic.slice(0, logic.lastIndexOf('end')).join('\n') // Drop trailing ['end', '\n'] from Control block.

Happy Feet

…ingDescribeFromControl.spec.ts

Signed-off-by: George Dias <gdias@mitre.org>
Signed-off-by: George Dias <gdias@mitre.org>
Signed-off-by: George Dias <gdias@mitre.org>
Signed-off-by: George Dias <gdias@mitre.org>
@georgedias georgedias linked an issue Mar 28, 2023 that may be closed by this pull request
6 tasks
@georgedias georgedias requested a review from em-c-rod March 29, 2023 04:16
Signed-off-by: George Dias <gdias@mitre.org>
@georgedias georgedias linked an issue Mar 29, 2023 that may be closed by this pull request
4 tasks
Signed-off-by: George Dias <gdias@mitre.org>
}

const escapeSpecialCaseBackslashes = (s: string) => {
//return s.replace(/\\\)/g, '\\\\)'); // Escape backslashes if preceding close parentheses
Copy link
Contributor

Choose a reason for hiding this comment

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

remove comment

Copy link
Contributor

@em-c-rod em-c-rod left a comment

Choose a reason for hiding this comment

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

Left a couple comments, but looks good overall.

Copy link
Contributor Author

@georgedias georgedias left a comment

Choose a reason for hiding this comment

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

done reviewing your comments.

Signed-off-by: George Dias <gdias@mitre.org>
Signed-off-by: George Dias <gdias@mitre.org>
Signed-off-by: George Dias <gdias@mitre.org>

if (this.impact) {
result += ` impact ${this.impact}\n`;
if (this.impact !== undefined) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Great catch

@em-c-rod em-c-rod merged commit cfe5a4a into main Mar 31, 2023
@em-c-rod em-c-rod deleted the describeBlockReturnFix branch March 31, 2023 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Describe Block Code Generation Failing Common updates

2 participants