From ae925f6791b1f66f84695a827aa382eed01cf66d Mon Sep 17 00:00:00 2001
From: Rick Waldron <waldron.rick@gmail.com>
Date: Fri, 13 Jul 2018 16:39:32 -0400
Subject: [PATCH] Lint: make esid check allow "%" (#1638)

---
 tools/lint/lib/checks/esid.py                    | 7 ++++---
 tools/lint/test/fixtures/valid_esid_alternate.js | 2 +-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/tools/lint/lib/checks/esid.py b/tools/lint/lib/checks/esid.py
index cdfcac6678..fbe1f4fc41 100644
--- a/tools/lint/lib/checks/esid.py
+++ b/tools/lint/lib/checks/esid.py
@@ -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):
diff --git a/tools/lint/test/fixtures/valid_esid_alternate.js b/tools/lint/test/fixtures/valid_esid_alternate.js
index f079a22a09..2b9a5fe711 100644
--- a/tools/lint/test/fixtures/valid_esid_alternate.js
+++ b/tools/lint/test/fixtures/valid_esid_alternate.js
@@ -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
 ---*/
 
-- 
GitLab