From 25b6d58c6551c7b4294cf50dec49b108e625ccce Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Fri, 2 Aug 2024 21:40:30 -0700 Subject: [PATCH 1/5] Add `.gitkeep` as an ignored filename Closes #643 --- src/towncrier/_builder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/towncrier/_builder.py b/src/towncrier/_builder.py index d1f65f98..83a121c4 100644 --- a/src/towncrier/_builder.py +++ b/src/towncrier/_builder.py @@ -114,7 +114,7 @@ def find_fragments( If strict, raise ClickException if any fragments have an invalid name. """ - ignored_files = {".gitignore", ".keep", "readme", "readme.md", "readme.rst"} + ignored_files = {".gitignore", ".gitkeep", ".keep", "readme", "readme.md", "readme.rst"} if isinstance(config.template, str): # Template can be a tuple of (package_name, resource_name). # From c89f18ade7297d78d198dbbfa55d1b109a36f04d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 3 Aug 2024 04:43:37 +0000 Subject: [PATCH 2/5] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/towncrier/_builder.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/towncrier/_builder.py b/src/towncrier/_builder.py index 83a121c4..c775d74e 100644 --- a/src/towncrier/_builder.py +++ b/src/towncrier/_builder.py @@ -114,7 +114,14 @@ def find_fragments( If strict, raise ClickException if any fragments have an invalid name. """ - ignored_files = {".gitignore", ".gitkeep", ".keep", "readme", "readme.md", "readme.rst"} + ignored_files = { + ".gitignore", + ".gitkeep", + ".keep", + "readme", + "readme.md", + "readme.rst", + } if isinstance(config.template, str): # Template can be a tuple of (package_name, resource_name). # From 084b56d5286da753c58fbf867b58865b248fadb6 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Fri, 2 Aug 2024 21:46:37 -0700 Subject: [PATCH 3/5] Add newsfragment --- src/towncrier/newsfragments/643.feature | 1 + 1 file changed, 1 insertion(+) create mode 100644 src/towncrier/newsfragments/643.feature diff --git a/src/towncrier/newsfragments/643.feature b/src/towncrier/newsfragments/643.feature new file mode 100644 index 00000000..35a13bce --- /dev/null +++ b/src/towncrier/newsfragments/643.feature @@ -0,0 +1 @@ +Add ``.gitkeep`` as an ignored filename. From d47c62eb42fba6871c9c6acab7a31486054edce6 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 3 Aug 2024 01:22:25 -0700 Subject: [PATCH 4/5] Update configuration.rst --- docs/configuration.rst | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/docs/configuration.rst b/docs/configuration.rst index 4f253cd8..43f601ef 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -133,11 +133,20 @@ Top level keys ``ignore`` A case-insensitive list of filenames in the news fragments directory to ignore. + ``None`` by default. + ``towncrier check`` will fail if there are any news fragment files that have invalid filenames, except for those in the list. ``towncrier build`` will likewise fail, but only if this list has been configured (set to an empty list if there are no files to ignore). - Some filenames such as .gitignore, README.rst. README.md, and the template file, are automatically ignored. + The following filenames are automatically ignored. + + - ``.gitignore`` + - ``.gitkeep`` + - ``.keep`` + - ``README`` + - ``README.md`` + - ``README.rst`` + - the template file itself - ``None`` by default. Extra top level keys for Python projects ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From 4faf7f76468ae7d8fe61576ad32424300419dfec Mon Sep 17 00:00:00 2001 From: Adi Roiban Date: Sat, 3 Aug 2024 15:22:57 +0100 Subject: [PATCH 5/5] Update docs/configuration.rst --- docs/configuration.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/configuration.rst b/docs/configuration.rst index 43f601ef..fbbe730b 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -137,7 +137,7 @@ Top level keys ``towncrier check`` will fail if there are any news fragment files that have invalid filenames, except for those in the list. ``towncrier build`` will likewise fail, but only if this list has been configured (set to an empty list if there are no files to ignore). - The following filenames are automatically ignored. + The following filenames are automatically ignored, case insensitive. - ``.gitignore`` - ``.gitkeep``