Skip to content

implemneted ejs, php detection#1157

Open
itssachinkr wants to merge 1 commit into
quick-lint:masterfrom
itssachinkr:skbranch
Open

implemneted ejs, php detection#1157
itssachinkr wants to merge 1 commit into
quick-lint:masterfrom
itssachinkr:skbranch

Conversation

@itssachinkr

Copy link
Copy Markdown

No description provided.

@github-actions

github-actions Bot commented Jan 4, 2024

Copy link
Copy Markdown

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 strager left a comment

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
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
Copy Markdown
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 '<'.)

: public Test_Parse_Expression {};

TEST_F(Test_Parse_Warning, warn_on_ejs_or_php_syntax) {
test_lex("window.audioRecordingBitRate = <%= audioRecordingBitRate %>;",

Copy link
Copy Markdown
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
Copy Markdown
Author

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

@strager

strager commented Jan 5, 2024

Copy link
Copy Markdown
Collaborator

@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.

3 participants