Skip to content

caddyconfig: Only parse # as the start of a comment if preceded by whitespace #3267

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

Merged
merged 2 commits into from
May 5, 2020

Conversation

francislavoie
Copy link
Member

See discussion in https://caddy.community/t/example-for-redir/7475

Also updated caddy fmt to skip adding a space before # when it shouldn't

@francislavoie francislavoie requested a review from mholt April 16, 2020 02:07
@francislavoie francislavoie changed the title caddyconfig: Only parse # as start of comment if preceded by space caddyconfig: Only parse # as the start of a comment if preceded by a space Apr 16, 2020
@mholt mholt added the under review 🧐 Review is pending before merging label Apr 17, 2020
Copy link
Member

@mholt mholt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, but I think some more test cases will be needed to make sure it recognizes comments at the beginning of a file and the beginning of a line too (if such cases don't already exist).

@mholt mholt added this to the 2.1 milestone Apr 17, 2020
@tobya tobya changed the title caddyconfig: Only parse # as the start of a comment if preceded by a space caddyconfig: Only parse # as the start of a comment if preceded by a space or new line Apr 17, 2020
@francislavoie francislavoie changed the title caddyconfig: Only parse # as the start of a comment if preceded by a space or new line caddyconfig: Only parse # as the start of a comment if preceded by whitespace Apr 17, 2020
Copy link
Member

@mholt mholt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I like this change.

@mholt mholt merged commit 96d6d27 into caddyserver:master May 5, 2020
@mholt mholt removed the under review 🧐 Review is pending before merging label May 5, 2020
@francislavoie francislavoie deleted the comment-needs-space branch May 5, 2020 18:49
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.

2 participants