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:
@@ -49,12 +49,12 @@ func (ModelPost) TableName() string {
|
||||
|
||||
// ModelComment represents a comment on a post
|
||||
type ModelComment struct {
|
||||
ID int64 `gorm:"column:id;primaryKey;autoIncrement;type:bigint"`
|
||||
PostID int64 `gorm:"column:post_id;type:bigint;not null;index:idx_post_id"`
|
||||
UserID *int64 `gorm:"column:user_id;type:bigint;index:idx_user_id"`
|
||||
Content string `gorm:"column:content;type:text;not null"`
|
||||
CreatedAt time.Time `gorm:"column:created_at;type:timestamp;default:now()"`
|
||||
UpdatedAt time.Time `gorm:"column:updated_at;type:timestamp;default:now()"`
|
||||
ID int64 `gorm:"column:id;primaryKey;autoIncrement;type:bigint"`
|
||||
PostID int64 `gorm:"column:post_id;type:bigint;not null;index:idx_post_id"`
|
||||
UserID *int64 `gorm:"column:user_id;type:bigint;index:idx_user_id"`
|
||||
Content string `gorm:"column:content;type:text;not null"`
|
||||
CreatedAt time.Time `gorm:"column:created_at;type:timestamp;default:now()"`
|
||||
UpdatedAt time.Time `gorm:"column:updated_at;type:timestamp;default:now()"`
|
||||
|
||||
Post *ModelPost `gorm:"foreignKey:PostID;references:ID;constraint:OnDelete:CASCADE"`
|
||||
User *ModelUser `gorm:"foreignKey:UserID;references:ID;constraint:OnDelete:SET NULL"`
|
||||
|
||||
@@ -5,6 +5,9 @@ import (
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
"gopkg.in/yaml.v3"
|
||||
|
||||
"git.warky.dev/wdevs/relspecgo/pkg/models"
|
||||
"git.warky.dev/wdevs/relspecgo/pkg/readers"
|
||||
bunreader "git.warky.dev/wdevs/relspecgo/pkg/readers/bun"
|
||||
@@ -14,8 +17,6 @@ import (
|
||||
bunwriter "git.warky.dev/wdevs/relspecgo/pkg/writers/bun"
|
||||
gormwriter "git.warky.dev/wdevs/relspecgo/pkg/writers/gorm"
|
||||
yamlwriter "git.warky.dev/wdevs/relspecgo/pkg/writers/yaml"
|
||||
"github.com/stretchr/testify/require"
|
||||
"gopkg.in/yaml.v3"
|
||||
)
|
||||
|
||||
// ComparisonResults holds the results of database comparison
|
||||
@@ -38,7 +39,7 @@ func countDatabaseStats(db *models.Database) (tables, indexes, constraints int)
|
||||
constraints += len(table.Constraints)
|
||||
}
|
||||
}
|
||||
return
|
||||
return tables, indexes, constraints
|
||||
}
|
||||
|
||||
// compareDatabases performs comprehensive comparison between two databases
|
||||
|
||||
@@ -9,6 +9,10 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/jackc/pgx/v5"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"git.warky.dev/wdevs/relspecgo/pkg/models"
|
||||
"git.warky.dev/wdevs/relspecgo/pkg/readers"
|
||||
dctxreader "git.warky.dev/wdevs/relspecgo/pkg/readers/dctx"
|
||||
@@ -17,9 +21,6 @@ import (
|
||||
"git.warky.dev/wdevs/relspecgo/pkg/writers"
|
||||
jsonwriter "git.warky.dev/wdevs/relspecgo/pkg/writers/json"
|
||||
pgsqlwriter "git.warky.dev/wdevs/relspecgo/pkg/writers/pgsql"
|
||||
"github.com/jackc/pgx/v5"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
// getTestConnectionString returns a PostgreSQL connection string from environment
|
||||
|
||||
Reference in New Issue
Block a user