INNER CODE UNIT · Python
prune
wasm3/wasm3 · extra/format.py:141
def prune(self, dirpath, names, isdir):
"""Drop the ignored entries from `names`, in place. Handed the directories
os.walk offers, that is also how it is told not to descend into them."""
names[:] = [n for n in names if not self.ignores(dirpath, n, isdir)]
IGNORED = GitIgnore()
# Code that lives here but is not ours to style. Patterns are fnmatch against the
# repo-relative path, and `*` spans directory separators. Naming a blacklisted file on
# the command line still formats it -- this only filters the directory walk.
EXCLUDE = Blacklist(
[
# generated: wasm modules dumped as C byte arrays
"*.wasm.h",
"source/extra/*",
# vendored: the Fomu/LiteX SoC support code, tracked verbatim from upstream
"platforms/embedded/fomu/src/*",