Files
allwpilib/styleguide/clangformat.py
Tyler Veness aafca4ed7f Reduced duplication between formatting scripts with Task base class (#80)
Also added scripts for EOF newline management and for removing trailing whitespace. configure.bat was rewritten to use CRLF line endings. Documentation for the existing scripts was also improved.
2016-07-10 08:33:27 -07:00

16 lines
450 B
Python

# This task runs clang-format on all C++ source files.
import subprocess
import sys
from task import Task
class ClangFormat(Task):
def getIncludeExtensions(self):
return ["cpp", "h", "inc"]
def run(self, name):
# Run clang-format
if subprocess.call(["clang-format", "-i", "-style=file", name]) == -1:
print("Error: clang-format not found in PATH. Is it installed?",
file = sys.stderr)