chore(ci): add govulncheck, staticcheck, go vet, gofumpt gates
* Add lint/format checks to the Gitea release workflow and Makefile (targets: vet, fmt, fmt-check, staticcheck, govulncheck, check) * Switch .golangci.json formatter from gofmt to gofumpt (extra.group-params) * Bump golang.org/x/text 0.37.0 -> 0.39.0 for GO-2026-5970; re-vendor * Fix staticcheck S1011 in pkg/diff; drop unused pgsql writer helpers * Fix gocritic unnamedResult (pkg/diff) and rangeValCopy (pkg/pgsql) * Apply gofumpt + goimports formatting across the tree
This commit is contained in:
@@ -115,7 +115,7 @@ func (w *Writer) writeMultiFile(db *models.Database) error {
|
||||
}
|
||||
|
||||
// Create output directory if it doesn't exist
|
||||
if err := os.MkdirAll(w.options.OutputPath, 0755); err != nil {
|
||||
if err := os.MkdirAll(w.options.OutputPath, 0o755); err != nil {
|
||||
return fmt.Errorf("failed to create output directory: %w", err)
|
||||
}
|
||||
|
||||
@@ -163,7 +163,7 @@ func (w *Writer) writeEnumsFile(schema *models.Schema) error {
|
||||
|
||||
// Write to enums.ts file
|
||||
filename := filepath.Join(w.options.OutputPath, "enums.ts")
|
||||
return os.WriteFile(filename, []byte(code), 0644)
|
||||
return os.WriteFile(filename, []byte(code), 0o644)
|
||||
}
|
||||
|
||||
// writeTableFile writes a single table to its own file
|
||||
@@ -200,7 +200,7 @@ func (w *Writer) writeTableFile(table *models.Table, schema *models.Schema, db *
|
||||
// Sanitize table name to remove quotes, comments, and invalid characters
|
||||
safeTableName := writers.SanitizeFilename(table.Name)
|
||||
filename := filepath.Join(w.options.OutputPath, safeTableName+".ts")
|
||||
return os.WriteFile(filename, []byte(code), 0644)
|
||||
return os.WriteFile(filename, []byte(code), 0o644)
|
||||
}
|
||||
|
||||
// buildTableData builds TableData from a models.Table
|
||||
@@ -533,7 +533,7 @@ func (w *Writer) getForeignKeyForColumn(columnName string, table *models.Table)
|
||||
// writeOutput writes the content to file or stdout
|
||||
func (w *Writer) writeOutput(content string) error {
|
||||
if w.options.OutputPath != "" {
|
||||
return os.WriteFile(w.options.OutputPath, []byte(content), 0644)
|
||||
return os.WriteFile(w.options.OutputPath, []byte(content), 0o644)
|
||||
}
|
||||
|
||||
// Print to stdout
|
||||
|
||||
Reference in New Issue
Block a user