From 9b9a92928102b525aaeb33f8beb22da932280805 Mon Sep 17 00:00:00 2001 From: Laily Date: Mon, 31 Jul 2023 19:50:17 +0800 Subject: [PATCH] fix(ci): modify err check --- .golangci.yml | 31 ++++++++++++++----------------- .tmux.conf | 3 +++ .zshrc | 2 -- git/.gitconfig | 3 ++- git/.gitignore | 1 + nvim/lua/plugins.lua | 2 +- 6 files changed, 21 insertions(+), 21 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 91e9d47..ce220f7 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -4,6 +4,7 @@ run: linters: enable: - govet + - errcheck - staticcheck - ineffassign - typecheck @@ -17,6 +18,12 @@ linters: - errorlint # finds code that will cause problems with the error wrapping scheme introduced in Go 1.13 disable-all: true linters-settings: + errcheck: + exclude-functions: + - io/ioutil.ReadFile + - io.Copy(*bytes.Buffer) + - io.Copy(os.Stdout) + - net.(*) staticcheck: # SAxxxx checks in https://staticcheck.io/docs/configuration/options/#checks checks: ["all"] @@ -63,7 +70,7 @@ linters-settings: - name: argument-limit severity: warning disabled: false - arguments: [5] + arguments: [6] # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#atomic - name: atomic severity: warning @@ -72,7 +79,7 @@ linters-settings: - name: banned-characters severity: warning disabled: false - arguments: ["Ω", "Σ", "σ", "7"] + arguments: ["Ω", "Σ", "σ"] # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#bool-literal-in-expr - name: bool-literal-in-expr severity: warning @@ -86,14 +93,6 @@ linters-settings: severity: warning disabled: false arguments: [10] - # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#confusing-naming - - name: confusing-naming - severity: warning - disabled: false - # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#confusing-results - - name: confusing-results - severity: warning - disabled: false # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#constant-logical-expr - name: constant-logical-expr severity: warning @@ -156,15 +155,11 @@ linters-settings: arguments: - "checkPrivateReceivers" - "sayRepetitiveInsteadOfStutters" - # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#flag-parameter - - name: flag-parameter - severity: warning - disabled: false # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#function-result-limit - name: function-result-limit severity: warning disabled: false - arguments: [2] + arguments: [4] # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#function-length - name: function-length severity: warning @@ -292,12 +287,14 @@ linters-settings: # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unhandled-error - name: unhandled-error severity: warning - disabled: false + disabled: true + # bytes.Buffer.Write: package name, structure name, function name arguments: - "fmt.Printf" - "os.(Create|WriteFile|Chmod)" - "net.*" - - "bytes.Buffer.Write" + - "bytes.Buffer.WriteString" + - "con.WriteString" # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unnecessary-stmt - name: unnecessary-stmt severity: warning diff --git a/.tmux.conf b/.tmux.conf index 01317f4..fb37b47 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -32,6 +32,9 @@ bind -r L resizep -R 10 # 绑定Ctrl+l为往→调整面板边缘10个单元格 # 设置tmux的延迟,文档说当有干扰的时候可以设置这个参数,比如影响vim编辑的时候 set -s escape-time 1 +# 返回上一个窗口 +bind g last-window + # 设置窗口名为当前目录名 set-option -g status-interval 10 set-option -g automatic-rename on diff --git a/.zshrc b/.zshrc index bf48995..8335128 100644 --- a/.zshrc +++ b/.zshrc @@ -109,7 +109,6 @@ unsetopt BEEP export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.ustc.edu.cn/brew.git" export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.ustc.edu.cn/homebrew-core.git" export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.ustc.edu.cn/homebrew-bottles" -export HOMEBREW_NO_AUTO_UPDATE=true # 禁止 brew 每次安装软件都 upate # git export REVIEW_BASE="master" @@ -143,7 +142,6 @@ alias alert='terminal-notifier -title "Terminal" -message "Done with task! Exit # git alias gitb="git branch --show-current | tr -d '\n' | pbcopy" alias gci="golangci-lint run -c=~/.dotfile/.golangci.yml ./..." -alias gcis="golangci-lint run -c=~/.dotfile/.golangci_strict.yml ./..." alias gmt="go mod tidy" alias gtc="go test -gcflags=all=-l -cover ./..." alias swg="swag init -o docs -g " diff --git a/git/.gitconfig b/git/.gitconfig index 54d2093..6bcb213 100644 --- a/git/.gitconfig +++ b/git/.gitconfig @@ -8,6 +8,8 @@ excludesfile = ~/.dotfile/git/.gitignore [push] default = current +[pull] + rebase = false [merge] tool = vimdiff [includeIf "gitdir:~/workrepo/"] @@ -45,4 +47,3 @@ # git reviewone foo.js bar.js reviewone = !vim -p +\"tabdo Gdiff $REVIEW_BASE\" +\"let g:gitgutter_diff_base = '$REVIEW_BASE'\" #git filter-branch -f --env-filter "GIT_AUTHOR_NAME='Laily'; GIT_AUTHOR_EMAIL='i@laily.net'; GIT_COMMITTER_NAME='Laily'; GIT_COMMITTER_EMAIL='i@laily.net';" HEAD - diff --git a/git/.gitignore b/git/.gitignore index e774b53..0db6aaf 100644 --- a/git/.gitignore +++ b/git/.gitignore @@ -30,3 +30,4 @@ _testmain.go .log go.work go.work.sum +init_test.go diff --git a/nvim/lua/plugins.lua b/nvim/lua/plugins.lua index 78e7104..bd095bc 100644 --- a/nvim/lua/plugins.lua +++ b/nvim/lua/plugins.lua @@ -70,7 +70,7 @@ return require("packer").startup(function(use) -- vsnip use 'hrsh7th/cmp-vsnip' -- { name = 'vsnip' } use 'hrsh7th/vim-vsnip' - use 'rafamadriz/friendly-snippets' + -- use 'rafamadriz/friendly-snippets' -- lspkind use 'onsails/lspkind-nvim'