From adfa9f9e0f0940b0c0ead1cd15f29d09591e5f5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BA=90=E6=96=87=E9=9B=A8?= <41315874+fumiama@users.noreply.github.com> Date: Sat, 10 Dec 2022 14:11:09 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=A9=F0=9F=91=8C=20make=20lint=20happy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .golangci.yml | 3 --- kanban/gen/banner.go | 1 + plugin/hyaku/main.go | 4 +++- plugin/qqwife/command.go | 21 +++------------------ plugin/qqwife/favorSystem.go | 7 +++---- plugin/qqwife/function.go | 10 ++-------- 6 files changed, 12 insertions(+), 34 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index b7fc89cc..8707a542 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -18,7 +18,6 @@ linters: fast: false enable: - bodyclose - - deadcode - depguard - dogsled - errcheck @@ -39,13 +38,11 @@ linters: - nolintlint - rowserrcheck - staticcheck - - structcheck - stylecheck - typecheck - unconvert - unparam - unused - - varcheck - whitespace - prealloc - predeclared diff --git a/kanban/gen/banner.go b/kanban/gen/banner.go index 05153d99..6b0782d6 100644 --- a/kanban/gen/banner.go +++ b/kanban/gen/banner.go @@ -1,3 +1,4 @@ +// Package main generates banner.go package main import ( diff --git a/plugin/hyaku/main.go b/plugin/hyaku/main.go index 5a6487f5..78c23a52 100644 --- a/plugin/hyaku/main.go +++ b/plugin/hyaku/main.go @@ -1,4 +1,7 @@ // Package hyaku 百人一首 + +//nolint: asciicheck + package hyaku import ( @@ -23,7 +26,6 @@ import ( const bed = "https://gitcode.net/u011570312/OguraHyakuninIsshu/-/raw/master/" -// nolint: asciicheck type line struct { 番号, 歌人, 上の句, 下の句, 上の句ひらがな, 下の句ひらがな string } diff --git a/plugin/qqwife/command.go b/plugin/qqwife/command.go index dca75f11..f7996596 100644 --- a/plugin/qqwife/command.go +++ b/plugin/qqwife/command.go @@ -1,4 +1,7 @@ // Package qqwife 娶群友 基于“翻牌”和江林大佬的“群老婆”插件魔改作品,文案采用了Hana的zbp娶群友文案 + +//nolint: asciicheck + package qqwife import ( @@ -29,8 +32,6 @@ import ( // 货币系统 ) -// nolint: asciicheck -//nolint: asciicheck type 婚姻登记 struct { db *sql.Sqlite sync.RWMutex @@ -56,8 +57,6 @@ type userinfo struct { } var ( - // nolint: asciicheck - //nolint: asciicheck 民政局 = &婚姻登记{ db: &sql.Sqlite{}, } @@ -301,8 +300,6 @@ func init() { }) } -// nolint: asciicheck -//nolint: asciicheck func (sql *婚姻登记) 查看设置(gid int64) (dbinfo updateinfo, err error) { sql.Lock() defer sql.Unlock() @@ -324,16 +321,12 @@ func (sql *婚姻登记) 查看设置(gid int64) (dbinfo updateinfo, err error) return } -// nolint: asciicheck -//nolint: asciicheck func (sql *婚姻登记) 更新设置(dbinfo updateinfo) error { sql.Lock() defer sql.Unlock() return sql.db.Insert("updateinfo", &dbinfo) } -// nolint: asciicheck -//nolint: asciicheck func (sql *婚姻登记) 开门时间(gid int64) error { grouInfo, err := sql.查看设置(gid) if err != nil { @@ -354,8 +347,6 @@ func (sql *婚姻登记) 开门时间(gid int64) error { return nil } -// nolint: asciicheck -//nolint: asciicheck func (sql *婚姻登记) 查户口(gid, uid int64) (info userinfo, err error) { sql.Lock() defer sql.Unlock() @@ -373,8 +364,6 @@ func (sql *婚姻登记) 查户口(gid, uid int64) (info userinfo, err error) { return } -// nolint: asciicheck -//nolint: asciicheck // 民政局登记数据 func (sql *婚姻登记) 登记(gid, uid, target int64, username, targetname string) error { sql.Lock() @@ -390,8 +379,6 @@ func (sql *婚姻登记) 登记(gid, uid, target int64, username, targetname str return sql.db.Insert(gidstr, &uidinfo) } -// nolint: asciicheck -//nolint: asciicheck func (sql *婚姻登记) 花名册(gid int64) (list [][4]string, err error) { sql.Lock() defer sql.Unlock() @@ -437,8 +424,6 @@ func slicename(name string, canvas *gg.Context) (resultname string) { return } -// nolint: asciicheck -//nolint: asciicheck func (sql *婚姻登记) 清理花名册(gid ...string) error { sql.Lock() defer sql.Unlock() diff --git a/plugin/qqwife/favorSystem.go b/plugin/qqwife/favorSystem.go index 9ec5fe7b..3b14db55 100644 --- a/plugin/qqwife/favorSystem.go +++ b/plugin/qqwife/favorSystem.go @@ -1,3 +1,5 @@ +//nolint: asciicheck + package qqwife import ( @@ -12,6 +14,7 @@ import ( "github.com/FloatTech/zbputils/ctxext" zero "github.com/wdvxdr1123/ZeroBot" "github.com/wdvxdr1123/ZeroBot/message" + // 画图 "github.com/Coloured-glaze/gg" "github.com/FloatTech/floatbox/file" @@ -192,8 +195,6 @@ func init() { }) } -// nolint: asciicheck -//nolint: asciicheck func (sql *婚姻登记) 查好感度(uid, target int64) (int, error) { sql.Lock() defer sql.Unlock() @@ -246,8 +247,6 @@ func (sql *婚姻登记) getGroupFavorability(uid int64) (list favorList, err er return } -// nolint: asciicheck -//nolint: asciicheck // 设置好感度 正增负减 func (sql *婚姻登记) 更新好感度(uid, target int64, score int) (favor int, err error) { sql.Lock() diff --git a/plugin/qqwife/function.go b/plugin/qqwife/function.go index ffaa99a2..8ac4e9e4 100644 --- a/plugin/qqwife/function.go +++ b/plugin/qqwife/function.go @@ -1,3 +1,5 @@ +//nolint: asciicheck + package qqwife import ( @@ -359,8 +361,6 @@ func init() { }) } -// nolint: asciicheck -// nolint: asciicheck func (sql *婚姻登记) 判断CD(gid, uid int64, model string, cdtime float64) (ok bool, err error) { sql.Lock() defer sql.Unlock() @@ -386,8 +386,6 @@ func (sql *婚姻登记) 判断CD(gid, uid int64, model string, cdtime float64) return false, nil } -// nolint: asciicheck -// nolint: asciicheck func (sql *婚姻登记) 记录CD(gid, uid int64, mode string) error { sql.Lock() defer sql.Unlock() @@ -399,8 +397,6 @@ func (sql *婚姻登记) 记录CD(gid, uid int64, mode string) error { }) } -// nolint: asciicheck -// nolint: asciicheck func (sql *婚姻登记) 离婚休妻(gid, wife int64) error { sql.Lock() defer sql.Unlock() @@ -409,8 +405,6 @@ func (sql *婚姻登记) 离婚休妻(gid, wife int64) error { return sql.db.Del(gidstr, "where target = "+wifestr) } -// nolint: asciicheck -// nolint: asciicheck func (sql *婚姻登记) 离婚休夫(gid, husband int64) error { sql.Lock() defer sql.Unlock()