parsec-cloud
parsec-cloud copied to clipboard
Harden pyRight configuration
Each commit enable a new rule with it's required change
@vxgmichel pyright is now configured with:
-
reportMatchNotExhaustivewhich require match to catch all possible case.That correspond to the pattern
foo: bool match foo: case True: pass case _: # False is not tested passpreviously we had:
match timestamps_in_the_ballpark(s_data.timestamp, now): case TimestampOutOfBallpark() as error: return errorHere the case
Noneisn't tested -
reportUnnecessaryComparisonwhich signal when we are doing useless comparisonFor
ifbranch:foo = True if foo == False: # unnecessary passFor
match:foo: bool match foo: case True: pass case False: pass case _: # impossible, all case are tested pass