File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -167,6 +167,14 @@ or passing relevant ``filenames`` in addition to source and output directory in
167
167
168
168
__ https://github.com/sphinx-doc/sphinx-autobuild/issues/34
169
169
170
+ Debugging
171
+ =========
172
+
173
+ If the ``SPHINX_AUTOBUILD_DEBUG `` environment variable is present
174
+ and a file change is detected,
175
+ its path and the currently active ignore expressions are printed.
176
+ This is to help setting up the ignore expressions correctly.
177
+
170
178
Acknowledgements
171
179
================
172
180
Original file line number Diff line number Diff line change 3
3
from __future__ import annotations
4
4
5
5
import fnmatch
6
+ import os
6
7
import re
7
8
from pathlib import Path
8
9
@@ -23,6 +24,11 @@ def __repr__(self):
23
24
def __call__ (self , filename : str , / ):
24
25
"""Determine if 'path' should be ignored."""
25
26
normalised_path = Path (filename ).resolve ().as_posix ()
27
+ if "SPHINX_AUTOBUILD_DEBUG" in os .environ :
28
+ print (
29
+ f"SPHINX_AUTOBUILD_DEBUG: { normalised_path !r} has changed; "
30
+ f"ignores are { self } "
31
+ )
26
32
# Any regular pattern matches.
27
33
for pattern in self .regular_patterns :
28
34
# separators are normalised before creating the IgnoreFilter
You can’t perform that action at this time.
0 commit comments