Skip to content

Conversation

@eacherkan-via
Copy link
Contributor

This PR attempts to add the ability to run diff-quality from any project subfolder, fixing issue #573.

Since internally most of the diff_cover codebase is aligned to using paths relative to the git root, the most localized way to support relative paths would be to convert the path is in QualityReporter.violations, just before interacting with the violation tool's output (which will be relative to the current working directory).

The change in behavior is backward-compatible, and shouldn't introduce any regression.

Note that for SQLFluff this doesn't fix the issue, since SQLFluff doesn't go through QualityReporter.violations. For SQLFluff, a fix can be implemented in their own implementation of violations_batch, or else this logic should be moved to the caller function - BaseReportGenerator._diff_violations - but it feels less natural there, as in the rest of that function's concerns the paths should stay as they are.

@Bachmann1234
Copy link
Owner

Thanks for the fix! Ill get this out soon

@Bachmann1234 Bachmann1234 merged commit 89a3611 into Bachmann1234:main Jan 9, 2026
14 checks passed
@Bachmann1234
Copy link
Owner

Released https://pypi.org/project/diff-cover/10.2.0/

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.

2 participants