fix(cmd): handle errors and improve output formatting
* update error handling in various commands to use blank identifier * enhance output formatting for better readability * add golangci-lint to Makefile for linting checks
This commit is contained in:
+18
-18
@@ -61,21 +61,21 @@ type Style struct {
|
||||
CustomTypeCase Case // user-defined / domain types not in the built-in set
|
||||
|
||||
// --- Query layout ---
|
||||
Commas CommaStyle
|
||||
AlignColumns bool // pad SELECT list so values align
|
||||
AlignLineComments bool // align trailing -- comments in a block
|
||||
SelectAlignAs bool // pad between expression and AS in SELECT list
|
||||
SetAlignEqual bool // align = in UPDATE SET list
|
||||
IndentJoin bool // extra indentation for JOIN … ON lines
|
||||
JoinIndentSize int // extra indent levels for JOINs (default 1)
|
||||
WhereWrap WrapMode // always|when_long|never — each AND/OR on its own line
|
||||
WhereAndOrIndent bool // AND/OR indented one level under WHERE
|
||||
Commas CommaStyle
|
||||
AlignColumns bool // pad SELECT list so values align
|
||||
AlignLineComments bool // align trailing -- comments in a block
|
||||
SelectAlignAs bool // pad between expression and AS in SELECT list
|
||||
SetAlignEqual bool // align = in UPDATE SET list
|
||||
IndentJoin bool // extra indentation for JOIN … ON lines
|
||||
JoinIndentSize int // extra indent levels for JOINs (default 1)
|
||||
WhereWrap WrapMode // always|when_long|never — each AND/OR on its own line
|
||||
WhereAndOrIndent bool // AND/OR indented one level under WHERE
|
||||
|
||||
// --- Subqueries ---
|
||||
SubqueryOpening Placement // opening ( placement: same_line|new_line
|
||||
SubqueryContent Placement // content indentation: same_line|new_line
|
||||
SubqueryClosing Placement // closing ) placement: same_line|new_line
|
||||
SubquerySpaceBeforeParen bool // space before ( in subqueries
|
||||
SubqueryOpening Placement // opening ( placement: same_line|new_line
|
||||
SubqueryContent Placement // content indentation: same_line|new_line
|
||||
SubqueryClosing Placement // closing ) placement: same_line|new_line
|
||||
SubquerySpaceBeforeParen bool // space before ( in subqueries
|
||||
|
||||
// --- INSERT ---
|
||||
InsertCollapseValues bool // fold multiple VALUES rows onto fewer lines
|
||||
@@ -85,11 +85,11 @@ type Style struct {
|
||||
RoutineAsWrap bool // newline before AS $$
|
||||
|
||||
// --- PL/pgSQL body ---
|
||||
PlpgsqlMaxBlankLines int // max consecutive blank lines in body
|
||||
PlpgsqlDeclareAlignType bool // align type column in DECLARE block
|
||||
PlpgsqlDeclareAlignEq bool // align := / = in DECLARE block
|
||||
PlpgsqlIfThenNewline bool // THEN on its own line
|
||||
PlpgsqlLoopCollapse bool // collapse empty loop bodies to one line
|
||||
PlpgsqlMaxBlankLines int // max consecutive blank lines in body
|
||||
PlpgsqlDeclareAlignType bool // align type column in DECLARE block
|
||||
PlpgsqlDeclareAlignEq bool // align := / = in DECLARE block
|
||||
PlpgsqlIfThenNewline bool // THEN on its own line
|
||||
PlpgsqlLoopCollapse bool // collapse empty loop bodies to one line
|
||||
|
||||
// --- Expressions ---
|
||||
BinaryOpAlign bool // align =, <>, || etc. vertically in WHERE/expr lists
|
||||
|
||||
Reference in New Issue
Block a user