File: patterns.py

package info (click to toggle)
mkdocs-material 9.6.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 76,636 kB
  • sloc: javascript: 3,965; python: 3,622; makefile: 2
file content (27 lines) | stat: -rw-r--r-- 1,073 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
def get_exclusion_patterns():
    """
    Regex patterns, which will be compared against directory and file names
    case-sensitively. https://docs.python.org/3/library/re.html#re.search is the
    matching function and scans the whole string to find any pattern match. Used
    with the https://pypi.org/project/regex/ module.

    Additional remarks for pattern creation:
    - The compared paths will be always in POSIX format.
    - Each directory path will have a / at the end to allow to distinguish them
      from files.
    - Patterns for dynamic or custom paths like Virtual Environments (venv) or
      build site directories are created during plugin runtime.
    """
    return [
        r"/__pycache__/",               # Python cache directory

        r"/\.DS_Store$",                # macOS

        r"/[^/]+\.zip$",                # Generated files and folders

        r"/[^/]*\.cache($|/)",          # .cache files and folders

        r"/\.vscode/",                  # Common autogenerated IDE directories
        r"/\.vs/",
        r"/\.idea/",
    ]