Skip to content
Snippets Groups Projects
Commit c686cc60 authored by Rick Waldron's avatar Rick Waldron
Browse files

Lint: disallow calls to verifyConfigurable and verifyProperty in same file

parent acf6de15
No related branches found
No related tags found
No related merge requests found
import yaml
from ..check import Check
class CheckHarness(Check):
'''Ensure tests don't misuse harness APIs.'''
ID = 'HARNESS'
def run(self, name, meta, source):
print(source)
if 'verifyConfigurable(' in source and 'verifyProperty(' in source:
return 'verifyConfigurable & verifyProperty may not be used in the same file'
else:
return
......@@ -30,6 +30,7 @@ from lib.checks.esid import CheckEsid
from lib.checks.features import CheckFeatures
from lib.checks.frontmatter import CheckFrontmatter
from lib.checks.harnessfeatures import CheckHarnessFeatures
from lib.checks.harness import CheckHarness
from lib.checks.license import CheckLicense
from lib.checks.negative import CheckNegative
from lib.checks.filename import CheckFileName
......@@ -51,6 +52,7 @@ checks = [
CheckFrontmatter(),
CheckFeatures('features.txt'),
CheckHarnessFeatures(),
CheckHarness(),
CheckLicense(),
CheckNegative()
]
......
HARNESS - verifyConfigurable & verifyProperty may not be used in the same file
^ expected errors | v input
// Copyright (C) 2017 Rick Waldron. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-whatever
description: Minimal test
includes: [verifyProperty.js]
---*/
verifyConfigurable(Object, '');
verifyProperty(Object, {});
^ expected errors | v input
// Copyright (C) 2017 Rick Waldron. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-whatever
description: Minimal test
includes: [verifyProperty.js]
---*/
verifyConfigurable(Object, '');
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment