Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
test262
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pmaksimo
test262
Commits
0278a7d2
Commit
0278a7d2
authored
7 years ago
by
Adrian Heine
Committed by
Rick Waldron
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add es[56]?id checks
parent
b0338941
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tools/lint/lib/checks/esid.py
+31
-0
31 additions, 0 deletions
tools/lint/lib/checks/esid.py
tools/lint/lint.py
+2
-0
2 additions, 0 deletions
tools/lint/lint.py
with
33 additions
and
0 deletions
tools/lint/lib/checks/esid.py
0 → 100644
+
31
−
0
View file @
0278a7d2
from
..check
import
Check
import
re
class
CheckEsid
(
Check
):
'''
Ensure tests specify only valid `es6id
'
s
'''
ID
=
'
ESID
'
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])*)?(, |$))+
"
)
self
.
esidRegex
=
re
.
compile
(
r
"
^(pending|(prod|sec)-[-_A-Za-z0-9.%@]+)$
"
)
def
run
(
self
,
name
,
meta
,
source
):
if
not
meta
:
return
# es5ids are a mess
#if 'es5id' in meta:
# es5id = str(meta['es5id'])
# if self.es5idRegex.match(es5id) == None:
# return 'The `es5id` tag has the wrong format: %s' % es5id
if
'
es6id
'
in
meta
:
es6id
=
str
(
meta
[
'
es6id
'
])
if
self
.
es6idRegex
.
match
(
es6id
)
==
None
:
return
'
The `es6id` tag has the wrong format: %s
'
%
es6id
if
'
esid
'
in
meta
:
esid
=
str
(
meta
[
'
esid
'
])
if
self
.
esidRegex
.
match
(
esid
)
==
None
:
return
'
The `esid` tag has the wrong format: %s
'
%
esid
This diff is collapsed.
Click to expand it.
tools/lint/lint.py
+
2
−
0
View file @
0278a7d2
...
@@ -23,6 +23,7 @@ except ImportError:
...
@@ -23,6 +23,7 @@ except ImportError:
from
lib.collect_files
import
collect_files
from
lib.collect_files
import
collect_files
from
lib.checks.esid
import
CheckEsid
from
lib.checks.features
import
CheckFeatures
from
lib.checks.features
import
CheckFeatures
from
lib.checks.frontmatter
import
CheckFrontmatter
from
lib.checks.frontmatter
import
CheckFrontmatter
from
lib.checks.harnessfeatures
import
CheckHarnessFeatures
from
lib.checks.harnessfeatures
import
CheckHarnessFeatures
...
@@ -41,6 +42,7 @@ parser.add_argument('path',
...
@@ -41,6 +42,7 @@ parser.add_argument('path',
help
=
'
file name or directory of files to lint
'
)
help
=
'
file name or directory of files to lint
'
)
checks
=
[
checks
=
[
CheckEsid
(),
CheckFrontmatter
(),
CheckFrontmatter
(),
CheckFeatures
(
'
features.txt
'
),
CheckFeatures
(
'
features.txt
'
),
CheckHarnessFeatures
(),
CheckHarnessFeatures
(),
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment