Skip to content

Commit 05b92fa

Browse files
committed
Add 'gci' command
1 parent 9cac33b commit 05b92fa

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

.zshrc

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ alias txc="tmux_win_to_path"
105105
alias txn="rename_pane"
106106
alias goc="go_cover"
107107
alias gcl="go_clone"
108+
alias gci="go_ci"
108109
alias bkp="create_backup"
109110
alias ssht="ssh_multi"
110111
alias flat="cat_flat"
@@ -420,6 +421,25 @@ function go_clone() {
420421
return 0
421422
}
422423

424+
function go_ci() {
425+
if [[ $# -eq 0 ]] ; then
426+
echo "Usage: gci {path}"
427+
return 0
428+
fi
429+
430+
if ! command -v golangci-lint ; then
431+
echo "golangci-lint is not installed"
432+
return 1
433+
fi
434+
435+
CGO_ENABLED=1 golangci-lint run \
436+
--enable=nolintlint,gochecknoinits,bodyclose,gocritic \
437+
--disable=errcheck \
438+
"$@"
439+
440+
return $?
441+
}
442+
423443
function create_backup() {
424444
if [[ $# -eq 0 ]] ; then
425445
echo "Usage: bkp {file}"

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ bash <(curl -fsSL https://andy.one/dotfiles/install.sh)
3636
| `hf …` | `grep` over zsh history |
3737
| `goc` | Create HTML coverage report for Go sources |
3838
| `gcl {org}/{repo}` | Clone repository with Go sources |
39+
| `gci {path}` | Alias for `golangci-lint` |
3940
| `bkp {file}` | Create backup for file or directory |
4041
| `flat {file}` | Print flatten list of records |
4142
| `git release {version}` | Add signed version tag for the latest commit to the master branch |

install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ set -e
77

88
################################################################################
99

10-
VERSION="2.5.5"
10+
VERSION="2.5.6"
1111

1212
################################################################################
1313

0 commit comments

Comments
 (0)