Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix path target mode when used in subdirectory #1476

Merged
merged 2 commits into from
Feb 7, 2025

Conversation

marschattha
Copy link
Member

@marschattha marschattha commented Feb 5, 2025

Right now if you apply a formatting change bubbled up from qlty check command while in a sub directory, the application fails with an Result::unwrap() on an Err value.

The root of that issue lies in the fact that when you apply the format this way, formatter is run with only selected file paths (which are project root relative and not relative to cwd) and TargetMode is set to Path when that happens. Instead of normalizing relative paths based on cwd I think just using absoluete paths is a better approach and less likely to cause any issues.

Copy link
Contributor

qltysh bot commented Feb 5, 2025

Diff Coverage: The code coverage on the diff in this pull request is 28.6%.

Total Coverage: This PR will decrease coverage by 0.01%.

File Coverage Changes
Path File Coverage Δ Indirect
qlty-analysis/src/workspace_entries/workspace_entry_finder_builder.rs 0.1
qlty-check/src/planner/plugin_workspace_entry_finder_builder.rs -4.8
qlty-config/src/library.rs -0.5
🛟 Help
  • Diff Coverage: Coverage for added or modified lines of code (excludes deleted files). Learn more.

  • Total Coverage: Coverage for the whole repository, calculated as the sum of all File Coverage. Learn more.

  • File Coverage: Covered Lines divided by Covered Lines plus Missed Lines. (Excludes non-executable lines including blank lines and comments.)

    • Indirect Changes: Changes to File Coverage for files that were not modified in this PR. Learn more.

@marschattha marschattha requested a review from brynary February 6, 2025 15:58
@brynary
Copy link
Member

brynary commented Feb 6, 2025

Does this fix only apply to formatting or also issue fixes?

@marschattha
Copy link
Member Author

Does this fix only apply to formatting or also issue fixes?

Just tested with eslint suggestion, worked, not sure about the ai autofixes, don't have that setup.

@brynary brynary merged commit 67df41f into main Feb 7, 2025
7 of 8 checks passed
@brynary brynary deleted the ma/fix_formating_prompt_when_used_in_subdir branch February 7, 2025 16:35
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