import os
import platform
import lit.formats

# Suffixes supported by clang-format.
config.suffixes = [
    ".c",
    ".cc",
    ".cpp",
    ".h",
    ".m",
    ".mm",
    ".java",
    ".js",
    ".ts",
    ".proto",
    ".protodevel",
    ".pb.txt",
    ".txtpb",
    ".textproto",
    ".textpb",
    ".asciipb",
    ".td",
    ".test",
]

# AIX 'diff' command doesn't support --strip-trailing-cr, but the internal
# python implementation does, so use that for cross platform compatibility
if platform.system() == "AIX":
    config.test_format = lit.formats.ShTest()

# Create an empty .clang-format-ignore file so that tests don't get messed
# up if one exists higher in the tree
with open(".clang-format-ignore", "w"):
    pass
