-
Notifications
You must be signed in to change notification settings - Fork 12.8k
fix issue #6861, ignore hidden files by default #6894
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 issue #6861, ignore hidden files by default #6894
Conversation
Hi @HerringtonDarkholme, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution! The agreement was validated by Microsoft and real humans are currently evaluating your PR. TTYL, MSBOT; |
@@ -769,6 +769,10 @@ namespace ts { | |||
return pathLen > extLen && path.substr(pathLen - extLen, extLen) === extension; | |||
} | |||
|
|||
export function isHiddenFile(path: string): boolean { | |||
return getBaseFileName(path)[0] === "." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
;
missed
I think the functionality offered by #5980 is more general and should be preferred to adding special cases in the compiler. |
@DanielRosenwasser I think so. Should this pull request be closed for now and wait for #5980 merged? |
wait for #5980 |
Hi @HerringtonDarkholme, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution! The agreement was validated by Microsoft and real humans are currently evaluating your PR. TTYL, MSBOT; |
Hi @HerringtonDarkholme , we should be able to implement this fix without the glob feature for now. Do you still want to work on this? If so, you probably want to exclude the dotted folders as well, for example P.S. for folder exclude, you can take a look at how we exclude |
I'm happy to implement this! I will try to submit my pull request by next three day. If I'm too busy to implement it, I'll drop a comment here to transfer this feature to @zhengbli . |
After re-reading the code I still think glob is a more appropriate approach and is more requested feature. Adding a special case in compiler is not elegant indeed, adding common exclusion like |
@zhengbli the current implementation, as I understand it, already ignores dotted folder names, so this should be fine, shouldn't it? |
@DanielRosenwasser I think this PR only checks if the base file name, which doesn't include the folder name, starts with a dot or not. So I don't think the dotted folders are covered. I also tested the latest nightly, dotted folders are included as expected. @HerringtonDarkholme You are right that the implementation would be more elegant with support of glob patterns. However, as that PR may still need quite some time before merging in, and this change looks like a small one, my vote is to implement as is for now, and we can change the implementation later. Plus, I don't think we should "enforce" the exclusion in |
I still don't think ignoring hidden directory can be done without modifying Also, I'm quite busy with my daily work. Transferring this to @zhengbli is better. |
Fix #6861
I'm new to TypeScript compiler, please forgive my ignorance.
There are two places I modified: finding files when tsc start and detecting file changes.
isHiddenFile
is currently unixy only. I don't think the same logic applies on windows.