Skip to content

Conversation

tuxu
Copy link
Contributor

@tuxu tuxu commented Mar 12, 2025

Remove the line number from fingerprint. If the same fingerprint is already used for another issue in the same file, generate another one. This is more stable compared to the line number itself, which changes whenever code is added or removed above the issue.

@soul-catcher
Copy link
Owner

Thank you for opening pull request!

But I think adding a line of code to fingerprint is not an optimal solution for several reasons:

  1. If there are multiple duplicate lines in the code, only one warning will be displayed.
  2. This solution does not work in cases where the line of code is changed without affecting the problem (for example, after automatic formatting)

Also this adds requirement to have access to source code files.

I decided to look at how other tools, such as Ruff, solve this problem, and found them solution really elegant.

Fingerprint is based on:

  1. Error message
  2. File path
  3. Fingerprint of the previous issue with this path and error message.

I think this is the best way. Could you implement it in this pull request?

@tuxu tuxu force-pushed the stable-fingerprint branch from 2823df2 to ca36b19 Compare March 29, 2025 23:39
@tuxu
Copy link
Contributor Author

tuxu commented Mar 29, 2025

@soul-catcher Thanks for the feedback! I just adapted this PR. The error level and code are kept in the fingerprint to hash the full message.

@tuxu tuxu force-pushed the stable-fingerprint branch from ca36b19 to 9090f61 Compare March 29, 2025 23:44
Remove the line number from fingerprint. If the same fingerprint is
already used for another issue in the same file, generate another one.
This is more stable compared to the line number itself, which changes
whenever code is added or removed above the issue.
@tuxu tuxu force-pushed the stable-fingerprint branch from 9090f61 to 934e0f5 Compare March 29, 2025 23:47
@soul-catcher
Copy link
Owner

I checked this in my private Gitlab repo and it works perfectly! Thank you!

@soul-catcher soul-catcher merged commit 7f9ea0f into soul-catcher:main Mar 31, 2025
2 checks passed
@tuxu
Copy link
Contributor Author

tuxu commented Mar 31, 2025

Awesome. Thanks for merging and creating a new release!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants