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

🏗🐛 Lint the contents of validator/ #15444

Merged
merged 3 commits into from
May 19, 2018
Merged

🏗🐛 Lint the contents of validator/ #15444

merged 3 commits into from
May 19, 2018

Conversation

rsimha
Copy link
Contributor

@rsimha rsimha commented May 19, 2018

This PR does the following:

  1. Enables eslint linting for the contents of validator/
  2. Adds a custom .eslintrc file for validator/ that supports node and jasmine code
  3. Auto-fixes as many lint errors as possible using gulp lint --files=validator/**/*.js --fix
  4. Switches all the lint rules for which failures remain to warning mode (so they can be fixed whenever possible)

@rsimha
Copy link
Contributor Author

rsimha commented May 19, 2018

/to @Gregable @honeybadgerdontcare

Copy link
Contributor

@honeybadgerdontcare honeybadgerdontcare left a comment

Choose a reason for hiding this comment

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

did you test that the validator chrome extension worked locally after this change?

'\/+(?!>))' + // e.g. "/"
'([^\\t\\r\\n /=>][^\\t\\r\\n =>]*|' + // e.g. "href"
'[^\\t\\r\\n =>]+[^ >]|' + // e.g. "/asdfs/asd"
'\/+(?!>))' + // e.g. "/"
Copy link
Contributor

Choose a reason for hiding this comment

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

boo. sad lint can't accept this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed by turning off the no-multi-spaces rule and reverting this (and other similar) changes.

Copy link
Contributor

@honeybadgerdontcare honeybadgerdontcare left a comment

Choose a reason for hiding this comment

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

did you test that the validator chrome extension worked locally after this change?

Copy link
Contributor

@honeybadgerdontcare honeybadgerdontcare left a comment

Choose a reason for hiding this comment

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

did you test that the validator chrome extension worked locally after this change?

@rsimha
Copy link
Contributor Author

rsimha commented May 19, 2018

@honeybadgerdontcare PTAL.

I tested the chrome extension locally as follows:

  1. Installed bower and polybuild
  2. Ran validator/chromeextension/build_extension.sh and validator/chromeextension/package_extension.sh
  3. Checked that the extension in the zip file installed fine, and showed no validation errors with www.ampproject.org

Does this sound good?

Copy link
Contributor

@honeybadgerdontcare honeybadgerdontcare left a comment

Choose a reason for hiding this comment

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

Sounds good.

@rsimha
Copy link
Contributor Author

rsimha commented May 19, 2018

Cool, will merge, and rebase #15443 on this PR to confirm that they work well together.

@rsimha rsimha merged commit efac204 into ampproject:master May 19, 2018
@rsimha rsimha deleted the 2018-05-19-LintValidator branch May 19, 2018 16:21
twifkak added a commit to twifkak/amphtml that referenced this pull request May 21, 2018
@twifkak twifkak mentioned this pull request May 21, 2018
honeybadgerdontcare pushed a commit that referenced this pull request May 22, 2018
 - Revision bump for #14782
 - Linter tweaks for #15444
 - Test allowed_protocol:http and !allow_relative:false
 - Allow relative URLs for amp-story attributes
 - Restrict CSS to 1000 bytes per inline style
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.

3 participants