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: make esid check allow "%" #1638

Merged
merged 1 commit into from Jul 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 4 additions & 3 deletions tools/lint/lib/checks/esid.py
Expand Up @@ -8,11 +8,12 @@ class CheckEsid(Check):
def __init__(self):
#self.es5idRegex = re.compile(r"^S?(B|\d+)(\.\d+)+(-(\d+|[a-z]|i+))*(_A\d(\.\d+)?(_T\d(\.\d+)?)?)?$")
self.es6idRegex = re.compile(r"^(S?(B|\d+)(\.\d+)+(((_A\d\.\d)?_T?\d)|[ _]S\d+(\.[a-z])*)?(, |$))+")
# Simpliiied version of the WhatWG URL specification for fragment
# parsing
# Simplified version of the WhatWG URL specification for fragment
# parsing:
# https://url.spec.whatwg.org/#fragment-state
# However, that must also include "%"
self.esidRegex = re.compile(
u"^[a-z0-9!$&'()*+,\-./:;=?@_~\u00a0-\U0010fffd]+$", re.IGNORECASE
u"^[a-z0-9!$%&'()*+,\-./:;=?@_~\u00a0-\U0010fffd]+$", re.IGNORECASE
)

def run(self, name, meta, source):
Expand Down
2 changes: 1 addition & 1 deletion tools/lint/test/fixtures/valid_esid_alternate.js
Expand Up @@ -2,7 +2,7 @@
// Copyright (C) 2017 Mike Pennisi. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: use-strict-directive!@$&*()_+
esid: use-strict-directive!@$%&*()_+
description: Minimal test
---*/

Expand Down