mirror of
https://github.com/tc39/test262.git
synced 2025-07-28 16:34:27 +02:00
Don't require Inflect for linting files (#3839)
This commit is contained in:
parent
e27c9f690c
commit
a8bd958193
@ -5,7 +5,6 @@
|
|||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import inflect
|
|
||||||
import os
|
import os
|
||||||
try:
|
try:
|
||||||
from pip._internal import main as pip
|
from pip._internal import main as pip
|
||||||
@ -15,8 +14,6 @@ except ImportError:
|
|||||||
from pip.req import parse_requirements, InstallRequirement
|
from pip.req import parse_requirements, InstallRequirement
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
ie = inflect.engine()
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
__import__('yaml')
|
__import__('yaml')
|
||||||
except ImportError:
|
except ImportError:
|
||||||
@ -97,7 +94,7 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
files = [path for _path in args.path for path in collect_files(_path)]
|
files = [path for _path in args.path for path in collect_files(_path)]
|
||||||
file_count = len(files)
|
file_count = len(files)
|
||||||
print('Linting %s %s' % (file_count, ie.plural('file', file_count)))
|
print('Linting %s file(s)' % (file_count))
|
||||||
|
|
||||||
all_errors = lint(files)
|
all_errors = lint(files)
|
||||||
unexpected_errors = dict(all_errors)
|
unexpected_errors = dict(all_errors)
|
||||||
@ -109,7 +106,7 @@ if __name__ == '__main__':
|
|||||||
del unexpected_errors[file_name]
|
del unexpected_errors[file_name]
|
||||||
|
|
||||||
error_count = len(unexpected_errors)
|
error_count = len(unexpected_errors)
|
||||||
print('Linting complete. %s %s found.' % (error_count, ie.plural('error', error_count)))
|
print('Linting complete. %s error(s) found.' % (error_count))
|
||||||
|
|
||||||
if error_count == 0:
|
if error_count == 0:
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
@ -1,2 +1 @@
|
|||||||
PyYAML==5.1.2
|
PyYAML==5.1.2
|
||||||
inflect==0.2.5
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user