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: ignore file detection when directory contains period #634

Merged
merged 1 commit into from
Mar 18, 2022
Merged

fix: ignore file detection when directory contains period #634

merged 1 commit into from
Mar 18, 2022

Conversation

JSanchezIO
Copy link
Contributor

I was using CSharpier in a project whose directory name contained a period, e.g., /home/jsanchezio/Documents/Repos/My.Project/, and despite having a .csharpierignore file, it would still report files excluded by the ignore as unformatted. I was running the command as dotnet csharpier --check . After some investigation, it turns out fileSystem.Path.GetExtension(directoryOrFile) would return the path after the period, e.g., .Project. This change alters the command to instead check if the directoryOrFile is a directory that exists and reacts accordingly.

After I discovered the issue, I renamed my project's folder name and all worked well. However, in CI environments there is no guarantee that a . won't be in the path, so I figured it was best to handle it within CSharpier.

@JSanchezIO JSanchezIO changed the title fix: ignore file detection when directory contains . fix: ignore file detection when directory contains period Mar 18, 2022
Copy link
Collaborator

@shocklateboy92 shocklateboy92 left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

@shocklateboy92 shocklateboy92 merged commit 02ae85b into belav:master Mar 18, 2022
@belav belav added this to the 0.16.0 milestone Mar 26, 2022
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.

None yet

3 participants