Don't require Inflect for linting files (#3839)

This commit is contained in:
André Bargull 2023-08-28 16:22:19 +02:00 committed by GitHub
parent e27c9f690c
commit a8bd958193
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 6 deletions

View File

@ -5,7 +5,6 @@
from __future__ import print_function
import argparse
import inflect
import os
try:
from pip._internal import main as pip
@ -15,8 +14,6 @@ except ImportError:
from pip.req import parse_requirements, InstallRequirement
import sys
ie = inflect.engine()
try:
__import__('yaml')
except ImportError:
@ -97,7 +94,7 @@ if __name__ == '__main__':
files = [path for _path in args.path for path in collect_files(_path)]
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)
unexpected_errors = dict(all_errors)
@ -109,7 +106,7 @@ if __name__ == '__main__':
del unexpected_errors[file_name]
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:
sys.exit(0)

View File

@ -1,2 +1 @@
PyYAML==5.1.2
inflect==0.2.5