implemneted ejs, php detection#1157
Conversation
|
CLA Assistant Lite bot: Thank you for your contribution! Like many free software projects, you must sign our Contributor License Agreement before we can accept your contribution. You can agree to the Contributor License Agreement by copy-pasting the following message into a new comment on this GitHub pull request: I have read and hereby agree to quick-lint-js' Contributor License Agreement (CLA-v1.md). You can retrigger this bot by commenting recheck in this Pull Request |
strager
left a comment
There was a problem hiding this comment.
Must fix: Compile and test the code on your machine. Doing so will make changes to a few more files. Include those changes in your pull request.
| TEST_F(Test_Parse_Warning, warn_on_ejs_or_php_syntax) { | ||
| test_lex("window.audioRecordingBitRate = <%= audioRecordingBitRate %>;", | ||
| " ^^^ Diag_EJS_or_PHP_Syntax_Detected"_diag); | ||
| } |
There was a problem hiding this comment.
Must fix: Put this test in test-lex.cpp, not here.
| if (this->input_[1] == '!' && this->input_[2] == '-' && | ||
| this->input_[3] == '-') { | ||
| // checking for EJS or PHP syntax | ||
| if((this->input_[0] == '<' && (this->input_[1] == '%')) || (this->input_[0] == '?')){ |
There was a problem hiding this comment.
Nit: Checking this->input_[0] == '<' is redundant. (Line 434 already checks for '<'.)
| : public Test_Parse_Expression {}; | ||
|
|
||
| TEST_F(Test_Parse_Warning, warn_on_ejs_or_php_syntax) { | ||
| test_lex("window.audioRecordingBitRate = <%= audioRecordingBitRate %>;", |
There was a problem hiding this comment.
Include a test for PHP-style syntax as well.
|
sir @strager , how to run and test the code on my machine? |
|
@pseudofool Instructions: https://quick-lint-js.com/contribute/build-from-source/ |
No description provided.