chore: bump pylint to 2.17 (#41576)

* build: bump pylint to 2.17

Xref: 5062345

* fix pylint consider-using-f-string warnings pt 1: use flynt for automated fixes

* fix pylint consider-using-f-string warnings pt 2: manual fixes

* fix pylint consider-using-with warnings

* fix pylint line-too-long warnings

* fix pylint unspecified-encoding warnings

* fix py lint consider-using-generator warning

* fixup! fix pylint unspecified-encoding warnings

* fix pylint line-too-long warnings
This commit is contained in:
Charles Kerr 2024-03-21 08:48:23 -05:00 committed by GitHub
parent 00da7279cb
commit 61ddb1aa07
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
25 changed files with 193 additions and 205 deletions

View file

@ -29,15 +29,15 @@ def run_node_configure(target_cpu):
def read_node_config_gypi():
config_gypi = os.path.join(NODE_DIR, 'config.gypi')
with open(config_gypi, 'r') as f:
content = f.read()
with open(config_gypi, 'r', encoding='utf-8') as file_in:
content = file_in.read()
return ast.literal_eval(content)
def read_electron_args():
all_gn = os.path.join(ELECTRON_DIR, 'build', 'args', 'all.gn')
args = {}
with open(all_gn, 'r') as f:
for line in f:
with open(all_gn, 'r', encoding='utf-8') as file_in:
for line in file_in:
if line.startswith('#'):
continue
m = re.match('([\w_]+) = (.+)', line)
@ -62,8 +62,8 @@ def main(target_file, target_cpu):
# Used by certain versions of node-gyp.
v['build_v8_with_gn'] = 'false'
with open(target_file, 'w+') as f:
f.write(pprint.pformat(config, indent=2))
with open(target_file, 'w+', encoding='utf-8') as file_out:
file_out.write(pprint.pformat(config, indent=2))
if __name__ == '__main__':
sys.exit(main(sys.argv[1], sys.argv[2]))