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

Ignore test suite third_party/ directories for lint #22498

Merged
merged 1 commit into from
Mar 27, 2020
Merged

Conversation

stephenmcgruer
Copy link
Contributor

@stephenmcgruer
Copy link
Contributor Author

Tested via:

# before PR
$ mkdir -p webrtc/third_party/sdp
$ touch webrtc/third_party/sdp/.gitignore
$ ./wpt lint webrtc
ERROR:lint:webrtc/third_party/sdp/.gitignore: .gitignore found outside the root (GITIGNORE)
INFO:lint:
INFO:lint:There was 1 error (GITIGNORE: 1)
INFO:lint:You must fix all errors; for details on how to fix them, see
INFO:lint:https://web-platform-tests.org/writing-tests/lint-tool.html
INFO:lint:
INFO:lint:However, instead of fixing a particular error, it's sometimes
INFO:lint:OK to add a line to the lint.whitelist file in the root of the
INFO:lint:web-platform-tests directory to make the lint tool ignore it.
INFO:lint:
INFO:lint:For example, to make the lint tool ignore all 'GITIGNORE'
INFO:lint:errors in the webrtc/third_party/sdp/.gitignore file,
INFO:lint:you could add the following line to the lint.whitelist file.
INFO:lint:
INFO:lint:GITIGNORE: webrtc/third_party/sdp/.gitignore
$
# apply changes from PR
$ ./wpt lint webrtc
$

Copy link
Contributor

@jgraham jgraham left a comment

Choose a reason for hiding this comment

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

Would be lovely to have an automated test, but I guess none of the other lint rules have one.

@stephenmcgruer
Copy link
Contributor Author

So I think it's mostly covered by test_parse_whitelist, plus test_lint_ignored_file. Looking at lint.py, it ultimately just loops the list of ignored patterns and passes them to fnmatch.fnmatch.

We could add a specific test for this, though it does blur the lines between testing the lint code and verifying the repository. Which might be fine! Let me know what you think.

@jgraham
Copy link
Contributor

jgraham commented Mar 27, 2020

I think this is fine as is if we're confident that the syntax is covered and we used the right syntax.

@jgraham jgraham merged commit a0d78a7 into master Mar 27, 2020
@jgraham jgraham deleted the smcgruer/lint branch March 27, 2020 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants