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: correctly process relative paths as --skip values #7737

Merged
merged 3 commits into from
Apr 20, 2024

Conversation

klkvr
Copy link
Member

@klkvr klkvr commented Apr 20, 2024

Motivation

Closes #7730

Solution

keep root path and try matching stripped path as well

Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Comment on lines 576 to 580
} else if let Ok(stripped) = file.strip_prefix(&self.project_root) {
is_match_exclude(matcher, stripped)
} else {
true
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style nit: I believe we can do

file.strip_prefix(&self.project_root).map_or(true, |stripped| is_match_exclude(matcher, stripped))

@klkvr klkvr merged commit 30f145f into master Apr 20, 2024
19 checks passed
@klkvr klkvr deleted the klkvr/fix-skip-filter branch April 20, 2024 12:40
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.

fix: make --skip flag aware of the project root
2 participants