Skip to content

Commit

Permalink
also exclude vscode and angular from snippet detection (#708)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp authored Mar 26, 2024
1 parent 8e4f0a1 commit 0e9f107
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 4 deletions.
27 changes: 23 additions & 4 deletions docs/exclusion.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,38 @@ public static class DefaultDirectoryExclusions
{
public static bool ShouldExcludeDirectory(string path)
{
var suffix = Path.GetFileName(path).ToLowerInvariant();
return suffix is
var suffix = Path
.GetFileName(path)
.ToLowerInvariant();
if (suffix is
// source control
".git" or

// ide temp files
".vs" or
".vscode" or
".idea" or

// angular cache
".angular" or

// package cache
"packages" or
"node_modules" or

// build output
"bin" or
"obj";
"obj")
{
return true;
}

var directory = new DirectoryInfo(path);
return directory.Attributes.HasFlag(FileAttributes.Hidden);
}
}
```
<sup><a href='/src/MarkdownSnippets/Reading/Exclusions/DefaultDirectoryExclusions.cs#L1-L17' title='Snippet source file'>snippet source</a> | <a href='#snippet-DefaultDirectoryExclusions.cs' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/MarkdownSnippets/Reading/Exclusions/DefaultDirectoryExclusions.cs#L1-L36' title='Snippet source file'>snippet source</a> | <a href='#snippet-DefaultDirectoryExclusions.cs' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,22 @@ public static bool ShouldExcludeDirectory(string path)
.GetFileName(path)
.ToLowerInvariant();
if (suffix is
// source control
".git" or

// ide temp files
".vs" or
".vscode" or
".idea" or

// angular cache
".angular" or

// package cache
"packages" or
"node_modules" or

// build output
"bin" or
"obj")
{
Expand Down

0 comments on commit 0e9f107

Please sign in to comment.