magento / magento/magento-coding-standard
Ignore HTML comments
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 375
- Forks
- 165
- PR merge metrics
- No merged PRs in 30d
Description
### Preconditions
1. Have a file test.html like this:
```
```
### Steps to reproduce
1. Run `vendor/bin/phpcs -s --standard=Magento2 test.html`
### Expected result
1. Show no errors.
### Actual result
1. Getting this output:
```
------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------
1 | ERROR | Avoid using self-closing tag with non-void html element - "
| | (Magento2.Html.HtmlSelfClosingTags.HtmlSelfClosingNonVoidTag)
------------------------------------------------------------------------------------------------
```
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the case with vendor/bin/phpcs -s --standard=Magento2 test.html and inspect the Magento2.Html.HtmlSelfClosingTags.HtmlSelfClosingNonVoidTag sniff reported in the output. Confirm that an HTML comment containing a URL produces no error, while the command still reports genuine self-closing-tag violations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 38/100