diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-06-27 16:38:18 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-06-27 16:38:18 +0000 |
commit | 0498fd5b50e25ab7c65471f382e27c76df8e30c1 (patch) | |
tree | 1bb0dd828c050251888c7fb65bfad048521b6348 /tools/pylint.py | |
parent | 9cf165bb6ef0dfd16e3bc64c4d942efc5ee0952a (diff) | |
parent | e0447aa1766a3e1cb73c82c41ff9d411d45b57fb (diff) | |
download | repohooks-androidx-sharetarget-release.tar.gz |
Snap for 8755081 from e0447aa1766a3e1cb73c82c41ff9d411d45b57fb to androidx-sharetarget-releaseandroidx-sharetarget-release
Change-Id: I8872fa2d68385e4c6e1cbc01ef82674939799324
Diffstat (limited to 'tools/pylint.py')
-rwxr-xr-x | tools/pylint.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/tools/pylint.py b/tools/pylint.py index 570f055..3fbb148 100755 --- a/tools/pylint.py +++ b/tools/pylint.py @@ -24,7 +24,7 @@ import subprocess assert (sys.version_info.major, sys.version_info.minor) >= (3, 6), ( - 'Python 3.6 or newer is required; found %s' % (sys.version,)) + f'Python 3.6 or newer is required; found {sys.version}') DEFAULT_PYLINTRC_PATH = os.path.join( @@ -37,8 +37,8 @@ def is_pylint3(pylint): result = subprocess.run([pylint, '--version'], stdout=subprocess.PIPE, check=True) if b'Python 3' not in result.stdout: - print('%s: unable to locate a Python 3 version of pylint; Python 3 ' - 'support cannot be guaranteed' % (__file__,), file=sys.stderr) + print(f'{__file__}: unable to locate a Python 3 version of pylint; ' + 'Python 3 support cannot be guaranteed', file=sys.stderr) return False return True @@ -55,8 +55,8 @@ def find_pylint3(): # If there's no pylint, give up. if not shutil.which('pylint'): - print('%s: unable to locate pylint; please install:\n' - 'sudo apt-get install pylint' % (__file__,), file=sys.stderr) + print(f'{__file__}: unable to locate pylint; please install:\n' + 'sudo apt-get install pylint', file=sys.stderr) sys.exit(1) return 'pylint' @@ -103,7 +103,7 @@ def main(argv): pylintrc = DEFAULT_PYLINTRC_PATH # If we pass a non-existent rcfile to pylint, it'll happily ignore # it. - assert os.path.exists(pylintrc), 'Could not find %s' % pylintrc + assert os.path.exists(pylintrc), f'Could not find {pylintrc}' cmd += ['--rcfile', pylintrc] cmd += unknown + opts.files @@ -116,10 +116,10 @@ def main(argv): return 0 except OSError as e: if e.errno == errno.ENOENT: - print('%s: unable to run `%s`: %s' % (__file__, cmd[0], e), + print(f'{__file__}: unable to run `{cmd[0]}`: {e}', file=sys.stderr) - print('%s: Try installing pylint: sudo apt-get install %s' % - (__file__, os.path.basename(cmd[0])), file=sys.stderr) + print(f'{__file__}: Try installing pylint: sudo apt-get install ' + f'{os.path.basename(cmd[0])}', file=sys.stderr) return 1 raise |