Bug 965120 - Use .clang-format to set tree default format; r=gps
new file mode 100644
--- /dev/null
+++ b/.clang-format
@@ -0,0 +1,1 @@
+BasedOnStyle: Mozilla
--- a/.clang-format-ignore
+++ b/.clang-format-ignore
@@ -1,2 +1,3 @@
\mfbt/
\js/
+\media/
--- a/tools/mach_commands.py
+++ b/tools/mach_commands.py
@@ -351,17 +351,17 @@ class FormatProvider(MachCommandBase):
except urllib2.HTTPError as e:
print("HTTP error {0}: {1}".format(e.code, e.reason))
return 1
from subprocess import Popen, PIPE
p1 = Popen(["hg", "diff", "-U0", "-r", "tip^", "--include", "glob:**.c", "--include", "glob:**.cpp",
"--include", "glob:**.h", "--exclude", "listfile:.clang-format-ignore"], stdout=PIPE)
- args = [sys.executable, clang_format_diff, "-p1", "-style=Mozilla"]
+ args = [sys.executable, clang_format_diff, "-p1"]
if not show:
args.append("-i")
p2 = Popen(args, stdin=p1.stdout)
return p2.communicate()[0]
def locate_or_fetch(self, root):
target = os.path.join(self._mach_context.state_dir, os.path.basename(root))
if not os.path.exists(target):