-
-
Notifications
You must be signed in to change notification settings - Fork 192
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
implemneted ejs, php detection #1157
base: master
Are you sure you want to change the base?
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 |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Checking this->input_[0] == '<'
is redundant. (Line 434 already checks for '<'.)
@@ -31,6 +31,11 @@ class Test_Parse_Warning : public Test_Parse_Expression {}; | |||
class Test_Error_Equals_Does_Not_Distribute_Over_Or | |||
: 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.