-
Notifications
You must be signed in to change notification settings - Fork 222
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
Checksyntaxwritefile #311
base: master
Are you sure you want to change the base?
Checksyntaxwritefile #311
Conversation
…s to make sure file reading works properly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. This test case fails but it is valid python syntax. It should pass.
it('should check syntax', function (done) {
PythonShell.checkSyntax("x=5#'").then(() => {
done();
})
})
I think you might be able to pipe the python code via standard in to not have to worry about string templating.
Also please move the checkSyntaxFile tests into their own describe block, as it now uses different logic
Okay, I have added changes, however I apologise I did not end up using stdin. The main reason was that I also had to add some extra functionality to make sure that command line special characters do not cause an issue. I will try to explain below: I was thinking about your example, and your suggestion of stdin was to stop the program thinking quotation marks within the user's code are meant to couple together with the quotation marks from the compileCommand for the python code right? So, with your example, where you did: However, I do realise my solution is kinda scuffed and far from the cleanest, so could you perhaps add a few test cases you can think of to make sure nothing goes wrong? I am very sorry for doing a solution this scuffed, I could not think of another solution for the command line special character problem. |
Changed checkSyntax to no longer write to files. Also, created separation between checkSyntax & checkSyntaxFile, as well as added more test cases & python files to ensure syntax checking is going well.