lint: clean up old statements
We can delete a number of disable statements that are no longer relevant,
replace the W/E/F constants with their human readable names, and scope a
few to where they're needed instead of disabling in the entire module.
BUG=None
TEST=`cros lint` is unchanged
Change-Id: Ic7ac1ab410917b075212b38412f8a1e381b8b915
Reviewed-on: https://chromium-review.googlesource.com/1135635
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Don Garrett <dgarrett@chromium.org>
diff --git a/scripts/cros_setup_toolchains.py b/scripts/cros_setup_toolchains.py
index b01d85c..3fdf440 100644
--- a/scripts/cros_setup_toolchains.py
+++ b/scripts/cros_setup_toolchains.py
@@ -29,7 +29,7 @@
# Only import portage after we've checked that we're inside the chroot.
# Outside may not have portage, in which case the above may not happen.
# We'll check in main() if the operation needs portage.
- # pylint: disable=F0401
+ # pylint: disable=import-error
import portage
@@ -346,7 +346,6 @@
The list of versions of the package currently installed.
"""
versions = []
- # pylint: disable=E1101
for pkg in PortageTrees(root)['vartree'].dbapi.match(atom, use_cache=0):
version = portage.versions.cpv_getversion(pkg)
versions.append(version)
@@ -365,7 +364,6 @@
A string containing the latest version.
"""
pkgtype = 'vartree' if installed else 'porttree'
- # pylint: disable=E1101
cpv = portage.best(PortageTrees(root)[pkgtype].dbapi.match(atom, use_cache=0))
return portage.versions.cpv_getversion(cpv) if cpv else None
@@ -933,7 +931,6 @@
atom = GetPortagePackage(target, pkg)
cat, pn = atom.split('/')
ver = GetInstalledPackageVersions(atom, root=root)[0]
- # pylint: disable=E1101
dblink = portage.dblink(cat, pn + '-' + ver, myroot=root,
settings=portage.settings)
contents = dblink.getcontents()
@@ -950,7 +947,6 @@
ver = GetInstalledPackageVersions(atom, root=root)[0]
logging.info('packaging %s-%s', atom, ver)
- # pylint: disable=E1101
dblink = portage.dblink(cat, pn + '-' + ver, myroot=root,
settings=portage.settings)
contents = dblink.getcontents()