From 9fce8471c0c58d0fccb258212a377e1595508a19 Mon Sep 17 00:00:00 2001 From: netpyoung Date: Fri, 22 Nov 2024 12:59:02 +0900 Subject: [PATCH] refactor: FRAGMENT_IGNORE_FILELIST --- .../NF.Tool.PatchNoteMaker.CLI/Impl/Const.cs | 9 +++++++++ .../NF.Tool.PatchNoteMaker.CLI/Impl/FragmentFinder.cs | 10 +--------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/NF.Tool.PatchNoteMaker/NF.Tool.PatchNoteMaker.CLI/Impl/Const.cs b/NF.Tool.PatchNoteMaker/NF.Tool.PatchNoteMaker.CLI/Impl/Const.cs index 6707fcd..d5526f7 100644 --- a/NF.Tool.PatchNoteMaker/NF.Tool.PatchNoteMaker.CLI/Impl/Const.cs +++ b/NF.Tool.PatchNoteMaker/NF.Tool.PatchNoteMaker.CLI/Impl/Const.cs @@ -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" + ]; } } diff --git a/NF.Tool.PatchNoteMaker/NF.Tool.PatchNoteMaker.CLI/Impl/FragmentFinder.cs b/NF.Tool.PatchNoteMaker/NF.Tool.PatchNoteMaker.CLI/Impl/FragmentFinder.cs index 225a162..283f912 100644 --- a/NF.Tool.PatchNoteMaker/NF.Tool.PatchNoteMaker.CLI/Impl/FragmentFinder.cs +++ b/NF.Tool.PatchNoteMaker/NF.Tool.PatchNoteMaker.CLI/Impl/FragmentFinder.cs @@ -57,15 +57,7 @@ public sealed class FragmentFinder { public static (Exception? exOrNull, FragmentResult result) FindFragments(string baseDirectory, PatchNoteConfig config, bool isStrictMode) { - HashSet ignoredFileNameSet = new HashSet(StringComparer.OrdinalIgnoreCase) - { - ".gitignore", - ".gitkeep", - ".keep", - "readme", - "readme.md", - "readme.rst" - }; + HashSet ignoredFileNameSet = new HashSet(Const.FRAGMENT_IGNORE_FILELIST, StringComparer.OrdinalIgnoreCase); if (!string.IsNullOrEmpty(config.Maker.TemplateFilePath)) {