Skip to content

Commit

Permalink
Make config.ignore filename list case-insensitive & add more automa…
Browse files Browse the repository at this point in the history
…tically ignored filenames
  • Loading branch information
MetRonnie committed Jul 15, 2024
1 parent 935a831 commit 5bba4eb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,11 @@ Top level keys
``true`` by default.

``ignore``
A list of filenames in the news fragments directory to ignore.
A case-insensitive list of filenames in the news fragments directory to ignore.

``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).

Note that if a custom template is stored in the news fragment directory, you should add it to this list.
Some filenames such as ``.gitignore`` and ``README`` are automatically ignored. However, if a custom template is stored in the news fragment directory, you should add it to this list.

``None`` by default.

Expand Down
4 changes: 2 additions & 2 deletions src/towncrier/_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def find_fragments(
If strict, raise ClickException if any fragments have an invalid name.
"""
ignored_files = {".gitignore"}
ignored_files = {".gitignore", ".keep", "readme", "readme.md", "readme.rst"}
if config.ignore:
ignored_files.update(config.ignore)

Expand All @@ -137,7 +137,7 @@ def find_fragments(
file_content = {}

for basename in files:
if basename in ignored_files:
if basename.lower() in ignored_files:
continue

issue, category, counter = parse_newfragment_basename(
Expand Down

0 comments on commit 5bba4eb

Please sign in to comment.