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

Describe Block Update Fix #21

Merged
merged 13 commits into from
Mar 31, 2023
Merged

Describe Block Update Fix #21

merged 13 commits into from
Mar 31, 2023

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 <[email protected]>
Signed-off-by: George Dias <[email protected]>
Signed-off-by: George Dias <[email protected]>
@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
@georgedias georgedias linked an issue Mar 29, 2023 that may be closed by this pull request
4 tasks
Signed-off-by: George Dias <[email protected]>
@@ -41,6 +41,11 @@ export function removeWhitespace(input: string): string {
return input.replace(/\s/gi, '')
}

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.

src/objects/control.ts Show resolved Hide resolved
src/objects/control.ts Show resolved Hide resolved
src/utilities/global.ts Show resolved Hide resolved
test/tests/control.spec.ts Outdated Show resolved Hide resolved
}
});
}

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