pylint: simplify PYLINTRC setup

The os.path.isfile(RC_FILE) check isn't necessary because RC_FILE
always exists -- it's checking for a static file in depot_tools.

os.environ.setdefault('PYLINTRC',...) is the same thing as checking
'PYLINTRC' in os.environ first.  Use that to simplify and drop the
if entirely.

Change-Id: Ib1fb8323c9bceebc5b22484988e9794586aa5e9a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6150451
Auto-Submit: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
changes/51/6150451/2
Mike Frysinger 2 months ago committed by LUCI CQ
parent 93954a51a1
commit 1dd73cd467

@ -41,8 +41,7 @@ def main(argv):
# their own PYLINTRC, or set an empty PYLINTRC to use pylint's normal config
# file resolution, which would include the "more global" options that are
# normally overridden by the depot_tools config.
if os.path.isfile(RC_FILE) and 'PYLINTRC' not in os.environ:
os.environ['PYLINTRC'] = RC_FILE
os.environ.setdefault('PYLINTRC', RC_FILE)
# This import has to happen after PYLINTRC is set because the module tries
# to resolve the config file location on load.

Loading…
Cancel
Save