3 # Wireshark - Network traffic analyzer
4 # By Gerald Combs <gerald@wireshark.org>
5 # Copyright 1998 Gerald Combs
7 # SPDX-License-Identifier: GPL-2.0-or-later
12 IGNORE_CONF
= "pre-commit-ignore.conf"
15 print("Usage: {0} [path/to/ignore.conf]".format(sys
.argv
[0]))
18 if len(sys
.argv
) == 2:
19 ignore_path
= sys
.argv
[1]
21 ignore_path
= IGNORE_CONF
23 # Function to load our patterns from 'path' for modified files
24 # to be ignored (skipping any comments)
25 def load_checkignore(path
):
29 except OSError as err
:
31 ign
= [line
.strip() for line
in patterns
.splitlines()]
32 ign
= [line
for line
in ign
if line
and not line
.startswith("#")]
35 ignore_list
= load_checkignore(ignore_path
)
39 if fnmatch
.fnmatchcase(f
, p
):
43 for line
in sys
.stdin
:
45 if not ignore_match(line
):
53 # indent-tabs-mode: nil
56 # ex: set shiftwidth=4 expandtab:
57 # :indentSize=4:noTabs=true: