Lines Matching +refs:clang +refs:format

1 //===-- clang-format/ClangFormat.cpp - Clang format tool ------------------===//
10 /// This file implements a clang-format tool that automatically formats
15 #include "clang/Basic/Diagnostic.h"
16 #include "clang/Basic/DiagnosticOptions.h"
17 #include "clang/Basic/FileManager.h"
18 #include "clang/Basic/SourceManager.h"
19 #include "clang/Basic/Version.h"
20 #include "clang/Format/Format.h"
21 #include "clang/Rewrite/Core/Rewriter.h"
28 using clang::tooling::Replacements;
34 static cl::OptionCategory ClangFormatCategory("Clang-format options");
49 "-length, clang-format will format up to the end\n"
55 cl::desc("<start line>:<end line> - format a range of\n"
63 Style("style", cl::desc(clang::format::StyleOptionHelpDescription),
64 cl::init(clang::format::DefaultFormatStyle),
69 "fallback in case clang-format is invoked with\n"
70 "-style=file, but can not find the .clang-format\n"
73 cl::init(clang::format::DefaultFallbackStyle),
79 "When reading from stdin, clang-format assumes this\n"
98 "clang-format from an editor integration"),
125 WarnFormat("Wclang-format-violations",
131 NoWarnFormat("Wno-clang-format-violations",
138 cl::desc("Set the maximum number of clang-format errors to emit before "
156 "If set, unknown format options are only warned about.\n"
160 "differing format depending on an option being\n"
179 namespace clang {
180 namespace format {
327 "code should be clang-formatted [-Wclang-format-violations]");
357 static bool format(StringRef FileName) {
462 } // namespace format
463 } // namespace clang
466 OS << clang::getClangToolFullVersion("clang-format") << '\n';
489 llvm::Expected<clang::format::FormatStyle> FormatStyle =
490 clang::format::getStyle(Style, FileName, FallbackStyle,
496 std::string Config = clang::format::configurationAsText(*FormatStyle);
509 "A tool to format C/C++/Java/JavaScript/Objective-C/Protobuf/C# code.\n\n"
527 Error = clang::format::format("-");
539 Error |= clang::format::format(FileName);