diff --git a/docs/configuration.rst b/docs/configuration.rst index 4f253cd8..fbbe730b 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, case insensitive. + + - ``.gitignore`` + - ``.gitkeep`` + - ``.keep`` + - ``README`` + - ``README.md`` + - ``README.rst`` + - the template file itself - ``None`` by default. Extra top level keys for Python projects ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/src/towncrier/_builder.py b/src/towncrier/_builder.py index d1f65f98..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", ".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). # 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.