HomePhabricator

[lint] support optional newlines when linting python's open function

Description

[lint] support optional newlines when linting python's open function

Summary:
This prevents false positives when linting code like this one:

with open(
    os.path.join(os.path.dirname(__file__), "ignore-logs.txt"), "rb"
) as ignoreList:
    self.ignoreList = ignoreList.readlines()

Test Plan:
Remove a few encoding="utf-8" in python code and check that the linter still detects them, with or without newlines.

arc lint --everything

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D13893

Details

Provenance
PiRKAuthored on May 12 2023, 19:14
PiRKPushed on May 13 2023, 06:30
Reviewer
Restricted Project
Differential Revision
D13893: [lint] support optional newlines when linting python's open function
Parents
rABCe41aa272b753: [lint] replace autopep8 with black (contrib/devtools)
Branches
Unknown
Tags
Unknown