def count()

in doc/FormattingDecisionComments/types.py [0:0]


def count(path, pattern):
    excludes = r'--exclude-dir=".*SUITE_data" --exclude=".*trpc_.*" --exclude=".*_pb.erl"'
    includes = r'--include=".*\.erl" --include=".*\.hrl"'
    cmd_string = f"pcregrep -r {excludes} {includes} {pattern} {path} | wc -l"
    out = os.popen(cmd_string).read()
    return int(out)