aboutsummaryrefslogtreecommitdiff
path: root/clang/tools/clang-format/clang-format-sublime.py
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2013-09-02 07:42:02 +0000
committerChandler Carruth <chandlerc@gmail.com>2013-09-02 07:42:02 +0000
commitbc36e6e0996267a58dbbfdee6e975a77bb780599 (patch)
tree2096005d35febd8d105372dce35842a36cf33d70 /clang/tools/clang-format/clang-format-sublime.py
parent402ee64f134e5d7d1b4f98ae3a6cf63c5d295775 (diff)
downloadllvm-bc36e6e0996267a58dbbfdee6e975a77bb780599.zip
llvm-bc36e6e0996267a58dbbfdee6e975a77bb780599.tar.gz
llvm-bc36e6e0996267a58dbbfdee6e975a77bb780599.tar.bz2
Switch the default mode for clang-format to '-file'. Make 'LLVM' the
fallback syntax used when we fail to find a '.clang-format' file. Adjust variable names appropriately. Update the editor integration pieces that specify a '-style' option to specify it as '-style=file'. I left the functionality in place because even if the preferred method is to use '.clang-format' files, this way if someone needs to clobber the style in their editor we show how to do so in these examples. Also check in a '.clang-format' file for Clang to ensure that separate checkouts and builds of Clang from LLVM can still get the nice formatting. =] This unfortunately required nuking the test for the absence of a '.clang-format' file as now the directory happening to be under your clang source tree will cause there to always be a file. ;] llvm-svn: 189741
Diffstat (limited to 'clang/tools/clang-format/clang-format-sublime.py')
-rw-r--r--clang/tools/clang-format/clang-format-sublime.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/tools/clang-format/clang-format-sublime.py b/clang/tools/clang-format/clang-format-sublime.py
index d41404e..73ff3dc 100644
--- a/clang/tools/clang-format/clang-format-sublime.py
+++ b/clang/tools/clang-format/clang-format-sublime.py
@@ -19,9 +19,10 @@ import subprocess
# Change this to the full path if clang-format is not on the path.
binary = 'clang-format'
-# Change this to format according to other formatting styles
-# (see clang-format -help).
-style = 'LLVM'
+# Change this to format according to other formatting styles. See the output of
+# 'clang-format --help' for a list of supported styles. The default looks for
+# a '.clang-format' file to indicate the style that should be used.
+style = 'file'
class ClangFormatCommand(sublime_plugin.TextCommand):
def run(self, edit):