Lines Matching +full:re +full:-
2 # SPDX-License-Identifier: GPL-2.0-only
6 # (c) 2014-2017 Valentin Rothberg <valentinrothberg@gmail.com>
14 import re
23 SYMBOL = r"(?:\w*[A-Z0-9]\w*){2,}"
31 REGEX_FILE_KCONFIG = re.compile(r".*Kconfig[\.\w+\-]*$")
32 REGEX_SYMBOL = re.compile(r'(?!\B)' + SYMBOL + r'(?!\B)')
33 REGEX_SOURCE_SYMBOL = re.compile(SOURCE_SYMBOL)
34 REGEX_KCONFIG_DEF = re.compile(DEF)
35 REGEX_KCONFIG_EXPR = re.compile(EXPR)
36 REGEX_KCONFIG_STMT = re.compile(STMT)
37 REGEX_FILTER_SYMBOLS = re.compile(r"[A-Za-z0-9]$")
38 REGEX_NUMERIC = re.compile(r"0[xX][0-9a-fA-F]+|[0-9]+")
39 REGEX_QUOTES = re.compile("(\"(.*?)\")")
47 "Please note that specifying commits will 'git reset --hard\' " \
53 parser.add_argument('-c', '--commit', dest='commit', action='store',
58 parser.add_argument('-d', '--diff', dest='diff', action='store',
61 "(e.g., -d commmit1..commit2)")
63 parser.add_argument('-f', '--find', dest='find', action='store_true',
66 "missing (required to run with --diff)")
68 parser.add_argument('-i', '--ignore', dest='ignore', action='store',
71 "(e.g., -i '.*defconfig')")
73 parser.add_argument('-s', '--sim', dest='sim', action='store', default="",
74 help="print a list of max. 10 string-similar symbols")
76 parser.add_argument('--force', dest='force', action='store_true',
80 parser.add_argument('--no-color', dest='color', action='store_false',
90 if args.diff and not re.match(r"^[\w\-\.\^]+\.\.[\w\-\.\^]+$", args.diff):
98 "calls 'git reset --hard' for some performance\nreasons. "
100 "'--force' if you\nwant to ignore this warning and "
105 sys.exit("The --commit option can't use the HEAD ref")
111 re.match(args.ignore, "this/is/just/a/test.c")
169 files = sorted(undefined_b.get(symbol) -
201 print("\t- %s (\"%s\")" % (yel(commit[0]), commit[1]))
203 print("\t- no commit found")
209 execute(["git", "reset", "--hard", commit])
238 commits = execute(["git", "log", "--pretty=oneline",
239 "--abbrev-commit", "-G",
247 stdout = execute(["git", "status", "--porcelain"])
249 if re.findall(r"[URMADC]{1}", line[:2]):
256 stdout = execute(["git", "rev-parse", "HEAD"])
261 """Partition list @lst into eveni-sized lists of size @size."""
271 """Return a list of max. ten Kconfig symbols that are string-similar to
294 # use 'git ls-files' to get the worklist
295 stdout = execute(["git", "ls-files"])
296 if len(stdout) > 0 and stdout[-1] == "\n":
297 stdout = stdout[:-1]
334 if ignore and re.match(ignore, gitfile):
370 if symbol[:-len("_MODULE")] in defined_symbols:
393 with open(sfile, "r", encoding='utf-8', errors='replace') as stream:
425 if ignore and re.match(ignore, kfile):
441 with open(kfile, "r", encoding='utf-8', errors='replace') as stream:
455 # multi-line statements