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()
Differential D13893
[lint] support optional newlines when linting python's open function PiRK on May 12 2023, 19:20. Authored by Tags None Subscribers None
Details
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() Remove a few encoding="utf-8" in python code and check that the linter still detects them, with or without newlines. arc lint --everything
Diff Detail
Event TimelineComment Actions make the regex more robust:
Run arc lint --everything to confirm it works on existing code, and check various line splittings for an open(...) call (ensure no false positives and no false negatives) |