Skip to content

Conversation

@ghost
Copy link

@ghost ghost commented Feb 11, 2020

PR for: #500

@ghost ghost requested review from JoeRobich, jmarolf and sandyarmstrong February 11, 2020 06:23
// Ignore generated code files.
return true;
}
else if (!filesToIgnore.IsEmpty && filesToIgnore.Any(f => document.FilePath.Contains(f, StringComparison.OrdinalIgnoreCase)))
Copy link
Author

Choose a reason for hiding this comment

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

Do we want to have ignore casing on this string compare? If so, should I also add it on :347

Copy link
Member

Choose a reason for hiding this comment

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

I would expect Program.GetFiles to normalize casing and make it consistent.

Copy link
Member

Choose a reason for hiding this comment

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

Also, since the paths should be normalized, I think .StartsWith might be "more correct" here.

Copy link
Author

Choose a reason for hiding this comment

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

Changed it to StartsWith, but I still need to keep the StringComparison bit since we're doing document.FilePath.StartsWith. Unlike the ImmutableHashset, document.FilePath's comparer doesn't ignore casing.

Copy link
Member

@JoeRobich JoeRobich left a comment

Choose a reason for hiding this comment

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

Thanks @jpshrader. This looks good, just want to update the resource string before merging.

// Ignore generated code files.
return true;
}
else if (!filesToIgnore.IsEmpty && filesToIgnore.Any(f => document.FilePath.Contains(f, StringComparison.OrdinalIgnoreCase)))
Copy link
Member

Choose a reason for hiding this comment

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

I would expect Program.GetFiles to normalize casing and make it consistent.

// Ignore generated code files.
return true;
}
else if (!filesToIgnore.IsEmpty && filesToIgnore.Any(f => document.FilePath.Contains(f, StringComparison.OrdinalIgnoreCase)))
Copy link
Member

Choose a reason for hiding this comment

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

Also, since the paths should be normalized, I think .StartsWith might be "more correct" here.

@JoeRobich
Copy link
Member

🎉

@JoeRobich JoeRobich merged commit 87e15d7 into dotnet:master Feb 12, 2020
@ghost
Copy link
Author

ghost commented Feb 12, 2020

Thanks @JoeRobich! If you've got anything you'd like a hand with, feel free to give me a shout.

@JoeRobich JoeRobich mentioned this pull request Feb 13, 2020
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