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

Add a lint rule for /> syntax on non-void HTML elements #40498

Merged
merged 3 commits into from
Sep 20, 2023

Conversation

zcorpan
Copy link
Member

@zcorpan zcorpan commented Jun 12, 2023

See #40473

@zcorpan
Copy link
Member Author

zcorpan commented Jun 12, 2023

How do I run the lint tests locally?

@foolip
Copy link
Member

foolip commented Jun 12, 2023

@zcorpan running tox in tools/ will probably run those tests. Then you probably have to read the source to figure out how to narrow it down to just run the tests you want.

@zcorpan
Copy link
Member Author

zcorpan commented Jun 19, 2023

I needed to run flake8 -v --append-config=/Users/simonpieters/git/web-platform-tests/wpt/tools/flake8.ini (with -v) to see what caused the failure.

./lint/rules.py:508:142: E501 line too long (542 > 141 characters)

Now fixed. Also removed wbr from the regexp since it's a void element.

Copy link
Member

@foolip foolip left a comment

Choose a reason for hiding this comment

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

Changes look good. Should be possible to write a test for this by copying other lint rule tests, but I'll leave it to you to judge if that's worthwhile or not.

@zcorpan
Copy link
Member Author

zcorpan commented Aug 29, 2023

Done, and confirmed that it works locally with:

pytest --cov=tools --cov-report=term

Changing the test to expect no errors makes it fail.

@zcorpan zcorpan requested a review from foolip August 31, 2023 11:45
@zcorpan zcorpan enabled auto-merge (squash) September 20, 2023 10:34
@zcorpan zcorpan merged commit db6e503 into master Sep 20, 2023
31 of 33 checks passed
@zcorpan zcorpan deleted the zcorpan/lint-slash-gt branch September 20, 2023 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants