mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
fix: Fix auto-reload with globs in IGNORE_FILES (#3441)
The default `IGNORE_FILES` value of `'.*'` was being compiled to a regular expression and then passed into `watchfiles.DefaultFilter` to filter out files when auto-reload is enabled. This commit compares the patterns from `IGNORE_FILES` directly with the filename to match the usage of `fnmatch` elsewhere in the codebase. The new filtering class will continue working as expected for custom `IGNORE_FILES` settings.
This commit is contained in:
parent
5be013d9d2
commit
543424aa41
4 changed files with 96 additions and 9 deletions
|
|
@ -150,13 +150,17 @@ Basic settings
|
|||
|
||||
READERS = {'foo': FooReader}
|
||||
|
||||
.. data:: IGNORE_FILES = ['.*']
|
||||
.. data:: IGNORE_FILES = ['**/.*']
|
||||
|
||||
A list of glob patterns. Files and directories matching any of these patterns
|
||||
will be ignored by the processor. For example, the default ``['.*']`` will
|
||||
A list of Unix glob patterns. Files and directories matching any of these patterns
|
||||
or any of the commonly hidden files and directories set by ``watchfiles.DefaultFilter``
|
||||
will be ignored by the processor. For example, the default ``['**/.*']`` will
|
||||
ignore "hidden" files and directories, and ``['__pycache__']`` would ignore
|
||||
Python 3's bytecode caches.
|
||||
|
||||
For a full list of the commonly hidden files set by ``watchfiles.DefaultFilter``,
|
||||
please refer to the `watchfiles documentation`_.
|
||||
|
||||
.. data:: MARKDOWN = {...}
|
||||
|
||||
Extra configuration settings for the Markdown processor. Refer to the Python
|
||||
|
|
@ -1423,3 +1427,4 @@ Example settings
|
|||
|
||||
.. _Jinja Environment documentation: https://jinja.palletsprojects.com/en/latest/api/#jinja2.Environment
|
||||
.. _Docutils Configuration: http://docutils.sourceforge.net/docs/user/config.html
|
||||
.. _`watchfiles documentation`: https://watchfiles.helpmanual.io/api/filters/#watchfiles.DefaultFilter.ignore_dirs
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue