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

implemneted ejs, php detection #1157

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

itssachinkr
Copy link

No description provided.

Copy link

github-actions bot commented Jan 4, 2024

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

Copy link
Collaborator

@strager strager left a 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.

Comment on lines +34 to +37
TEST_F(Test_Parse_Warning, warn_on_ejs_or_php_syntax) {
test_lex("window.audioRecordingBitRate = <%= audioRecordingBitRate %>;",
" ^^^ Diag_EJS_or_PHP_Syntax_Detected"_diag);
}
Copy link
Collaborator

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] == '?')){
Copy link
Collaborator

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 %>;",
Copy link
Collaborator

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.

@itssachinkr
Copy link
Author

sir @strager , how to run and test the code on my machine?

@strager
Copy link
Collaborator

strager commented Jan 5, 2024

@pseudofool Instructions: https://quick-lint-js.com/contribute/build-from-source/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants