mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
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.
16 lines
450 B
Python
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)
|