Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add .gitkeep as an ignored filename #647

Merged
merged 5 commits into from
Aug 3, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions docs/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
adiroiban marked this conversation as resolved.
Show resolved Hide resolved

- ``.gitignore``
- ``.gitkeep``
- ``.keep``
- ``README``
- ``README.md``
- ``README.rst``
- the template file itself

``None`` by default.

Extra top level keys for Python projects
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
9 changes: 8 additions & 1 deletion src/towncrier/_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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).
#
Expand Down
1 change: 1 addition & 0 deletions src/towncrier/newsfragments/643.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add ``.gitkeep`` as an ignored filename.