Skip to content

Commit

Permalink
refactor: FRAGMENT_IGNORE_FILELIST
Browse files Browse the repository at this point in the history
  • Loading branch information
netpyoung committed Nov 22, 2024
1 parent 6e567a2 commit 9fce847
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,14 @@ internal static class Const
public const string DESCRIPTION_CONFIG = @"Pass a custom config file at FILE_PATH.
Default: towncrier.toml or pyproject.toml file,
if both files exist, the first will take precedence.";

public static readonly string[] FRAGMENT_IGNORE_FILELIST = [
".gitignore",
".gitkeep",
".keep",
"readme",
"readme.md",
"readme.rst"
];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,7 @@ public sealed class FragmentFinder
{
public static (Exception? exOrNull, FragmentResult result) FindFragments(string baseDirectory, PatchNoteConfig config, bool isStrictMode)
{
HashSet<string> ignoredFileNameSet = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
{
".gitignore",
".gitkeep",
".keep",
"readme",
"readme.md",
"readme.rst"
};
HashSet<string> ignoredFileNameSet = new HashSet<string>(Const.FRAGMENT_IGNORE_FILELIST, StringComparer.OrdinalIgnoreCase);

if (!string.IsNullOrEmpty(config.Maker.TemplateFilePath))
{
Expand Down

0 comments on commit 9fce847

Please sign in to comment.