You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We want to generate the right fingerprint values from ruff for integration with gitlab code quality (PR). The question is, on what information should the fingerprint be based?
... and run ruff on it, we get two B006 violations:
$ ruff --select B --show-source scratch.pyscratch.py:1:9: B006 [*] Do not use mutable data structures for argument defaults |1 | def a(x=[]): | ^^ B0062 | x.append(1)3 | print(x) | = help: Replace with `None`; initialize within functionscratch.py:6:9: B006 [*] Do not use mutable data structures for argument defaults |6 | def b(y=[]): | ^^ B0067 | y.append(2)8 | print(y) | = help: Replace with `None`; initialize within function
How should these be hashed for the fingerprint? If we include only the message and the source of the violation ([]), we get to identical fingerprints. If we include the line number on the other hand, the fingerprint will change if any line is inserted or removed before them.
The text was updated successfully, but these errors were encountered:
We want to generate the right
fingerprint
values from ruff for integration with gitlab code quality (PR). The question is, on what information should the fingerprint be based?If we e.g. take the following python code ...
... and run ruff on it, we get two B006 violations:
How should these be hashed for the fingerprint? If we include only the message and the source of the violation (
[]
), we get to identical fingerprints. If we include the line number on the other hand, the fingerprint will change if any line is inserted or removed before them.The text was updated successfully, but these errors were encountered: