ruff/crates/ruff_linter
Fergus Longley 0eef834e89
Use project-relative path when calculating gitlab message fingerprint (#11532)
## Summary

Concurrent GitLab runners clone projects into separate directories, e.g.
`{builds_dir}/$RUNNER_TOKEN_KEY/$CONCURRENT_ID/$NAMESPACE/$PROJECT_NAME`.
Since the fingerprint uses the full path to the file, the fingerprints
calculated by Ruff are different depending on which concurrent runner it
executes on, so often an MR will appear to remove all existing issues
and add them with new fingerprints.

I've adjusted the fingerprint function to use the project relative path,
which fixes this. Unfortunately this will have a breaking change for any
current users of this output - the fingerprints will change and appear
in GitLab as all linting messages having been fixed and then created.

## Test Plan

`cargo nextest run`

Running `ruff check --output-format gitlab` in a git repo, moving the
repo and running again, verifying no diffs between the outputs
2024-05-26 14:10:04 -04:00
..
resources [flake8-self] Ignore sunder accesses in flake8-self rule (#11546) 2024-05-26 13:57:24 -04:00
src Use project-relative path when calculating gitlab message fingerprint (#11532) 2024-05-26 14:10:04 -04:00
__init__.py [pylint] (Re-)Implement import-private-name (C2701) (#9553) 2024-01-16 14:03:11 -05:00
Cargo.toml Bump version to v0.4.5 (#11502) 2024-05-23 01:09:01 +00:00