summaryrefslogtreecommitdiffstats
path: root/yql/essentials/tools/sql_formatter/sql_formatter.cpp
diff options
context:
space:
mode:
authorYDBot <[email protected]>2025-10-07 00:52:12 +0000
committerYDBot <[email protected]>2025-10-07 00:52:12 +0000
commit0f7e91aa5ae33d20f2ef0d5cb2c80bb66924417f (patch)
tree6307f61a54aea3be0afeeaf766a30597fe047e81 /yql/essentials/tools/sql_formatter/sql_formatter.cpp
parent86c7a4b4c37e709428ebc61fb8a6e79c7260374c (diff)
parent3ab4f52f9654e20e38084313aa6861cb0c17eb1d (diff)
Sync branches 251007-0050
Diffstat (limited to 'yql/essentials/tools/sql_formatter/sql_formatter.cpp')
-rw-r--r--yql/essentials/tools/sql_formatter/sql_formatter.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/yql/essentials/tools/sql_formatter/sql_formatter.cpp b/yql/essentials/tools/sql_formatter/sql_formatter.cpp
index d25e4817c91..546db2da8f7 100644
--- a/yql/essentials/tools/sql_formatter/sql_formatter.cpp
+++ b/yql/essentials/tools/sql_formatter/sql_formatter.cpp
@@ -24,12 +24,11 @@ int RunFormat(int argc, char* argv[]) {
opts.AddLongOption('p', "print-query", "print given query before parsing").NoArgument();
opts.AddLongOption('f', "obfuscate", "obfuscate query").NoArgument();
opts.AddLongOption("ansi-lexer", "use ansi lexer").NoArgument();
- opts.AddLongOption("langver", "Set current language version").Optional().RequiredArgument("VER")
- .Handler1T<TString>([&](const TString& str) {
- if (!NYql::ParseLangVersion(str, langver)) {
- throw yexception() << "Failed to parse language version: " << str;
- }
- });
+ opts.AddLongOption("langver", "Set current language version").Optional().RequiredArgument("VER").Handler1T<TString>([&](const TString& str) {
+ if (!NYql::ParseLangVersion(str, langver)) {
+ throw yexception() << "Failed to parse language version: " << str;
+ }
+ });
opts.SetFreeArgsNum(0);
opts.AddHelpOption();
@@ -73,8 +72,7 @@ int RunFormat(int argc, char* argv[]) {
TString frm_query;
TString error;
NYql::TIssues issues;
- if (!formatter->Format(queryString, frm_query, issues, res.Has("obfuscate") ?
- NSQLFormat::EFormatMode::Obfuscate : NSQLFormat::EFormatMode::Pretty)) {
+ if (!formatter->Format(queryString, frm_query, issues, res.Has("obfuscate") ? NSQLFormat::EFormatMode::Obfuscate : NSQLFormat::EFormatMode::Pretty)) {
++errors;
Cerr << "Error formatting query: " << issues.ToString() << Endl;
} else {