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

🐛 Fix issue with verification script in katas #328

Merged
merged 2 commits into from
Nov 24, 2019
Merged

Conversation

vexx32
Copy link
Owner

@vexx32 vexx32 commented Nov 23, 2019

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
Copy link
Collaborator

@steviecoaster steviecoaster left a comment

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