Skip to content

🐛 Fix issue with verification script in katas - #328

Merged
vexx32 merged 2 commits into
masterfrom
Katas/Restrictions
Nov 24, 2019
Merged

vexx32 merged 2 commits into
masterfrom
Katas/Restrictions

Conversation

@vexx32

@vexx32 vexx32 commented Nov 23, 2019 •

Copy link
Copy Markdown
Collaborator

PR Summary

CheckRestrictedLanguage() is far too stringent. It prevents usage of basic array indexing and member access.

This PR switches to detecting command names in the AST, while still letting users define sub-functions if they want.

Only functions defined within the test function itself will be allowed.

Changes

Update $verification scriptblock with a static analysis methodology that checks for command names that would cause commands outside the function to be called and throw an error.

Checklist

  • Pull Request has a meaningful title.
  • Summarised changes.
  • Pull Request is ready to merge & is not WIP.
  • Added tests / only testable interactively.
    • Make sure you add a new test if old tests do not effectively test the code changed.
  • Added documentation / opened issue to track adding documentation at a later date.

CheckRestrictedLanguage() is far too stringent.
It prevents usage of basic array indexing and member access.

Switch to detecting command names in the AST.
This also lets users define sub-functions if they want.

Only functions defined in the test function itself will be allowed.
@vexx32 vexx32 added PR-Needs-Review 🔍 Let's take a closer look! Category-Koans Invoking the Great Doubt labels Nov 23, 2019

@steviecoaster steviecoaster left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM!

@vexx32
vexx32 merged commit 9b028d1 into master Nov 24, 2019
@vexx32
vexx32 deleted the Katas/Restrictions branch November 24, 2019 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Category-Koans Invoking the Great Doubt PR-Needs-Review 🔍 Let's take a closer look!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants