chore(draw): fix lint
parent
2dd24d7a62
commit
ef958c82de
|
@ -7,5 +7,9 @@
|
|||
# VSCode
|
||||
.vscode
|
||||
|
||||
# Go
|
||||
coverage.out
|
||||
vendor
|
||||
|
||||
# QMK
|
||||
dztech_dz60rgb_wkl_v2_1_haunt98.bin
|
||||
|
|
|
@ -0,0 +1,93 @@
|
|||
run:
|
||||
timeout: 5m
|
||||
tests: false
|
||||
skip-dirs:
|
||||
- ".*test.*"
|
||||
- ".*mock.*"
|
||||
- ".*example.*"
|
||||
- ".*utils.*"
|
||||
skip-files:
|
||||
- ".*Mock.*"
|
||||
- ".*_mock.*"
|
||||
|
||||
output:
|
||||
sort-results: true
|
||||
|
||||
linters:
|
||||
disable-all: true
|
||||
enable:
|
||||
# Default
|
||||
- errcheck
|
||||
- gosimple
|
||||
- govet
|
||||
- ineffassign
|
||||
- staticcheck
|
||||
- typecheck
|
||||
- unused
|
||||
# Custom
|
||||
- errchkjson
|
||||
- errname
|
||||
- errorlint
|
||||
- execinquery
|
||||
- forcetypeassert
|
||||
- gocritic
|
||||
- goerr113
|
||||
- gofumpt
|
||||
- gosec
|
||||
- importas
|
||||
- makezero
|
||||
- nilnil
|
||||
- noctx
|
||||
- prealloc
|
||||
- reassign
|
||||
# - rowserrcheck
|
||||
- sqlclosecheck
|
||||
- unconvert
|
||||
# - wastedassign
|
||||
fast: true
|
||||
|
||||
linters-settings:
|
||||
# Default
|
||||
govet:
|
||||
check-shadowing: false
|
||||
disable-all: true
|
||||
enable:
|
||||
- assign
|
||||
- atomic
|
||||
- bools
|
||||
- buildtag
|
||||
- composites
|
||||
- copylocks
|
||||
- fieldalignment
|
||||
- httpresponse
|
||||
- loopclosure
|
||||
- lostcancel
|
||||
- nilfunc
|
||||
- printf
|
||||
- unmarshal
|
||||
- unreachable
|
||||
- unusedresult
|
||||
staticcheck:
|
||||
checks: ["all", "-SA1019"]
|
||||
# Custom
|
||||
gocritic:
|
||||
disabled-checks:
|
||||
- ifElseChain
|
||||
- singleCaseSwitch
|
||||
- unnamedResult
|
||||
- whyNoLint
|
||||
enabled-tags:
|
||||
- diagnostic
|
||||
- style
|
||||
gosec:
|
||||
excludes:
|
||||
- G101
|
||||
- G112
|
||||
- G402
|
||||
- G404
|
||||
- G501
|
||||
- G505
|
||||
exclude-generated: true
|
||||
reassign:
|
||||
patterns:
|
||||
- ".*"
|
12
Makefile
12
Makefile
|
@ -1,4 +1,4 @@
|
|||
.PHONY: all format clean dztech_dz60rgb_wkl
|
||||
.PHONY: all format clean dztech_dz60rgb_wkl go
|
||||
|
||||
all:
|
||||
qmk setup
|
||||
|
@ -30,3 +30,13 @@ dztech_dz60rgb_wkl:
|
|||
# Draw
|
||||
curl https://raw.githubusercontent.com/qmk/qmk_firmware/master/keyboards/dztech/dz60rgb_wkl/info.json --output dztech_dz60rgb_wkl/info.json
|
||||
QMK_INFO=dztech_dz60rgb_wkl/info.json QMK_KEYMAP=dztech_dz60rgb_wkl/keymaps_json/haunt98/keymap.json OUT=dztech_dz60rgb_wkl/asciiart/haunt98.txt POST_PROCESS_TABLE=true go run ./cmd/qmkasciigen/*.go
|
||||
|
||||
# From changeloguru
|
||||
go:
|
||||
go install github.com/haunt98/go-test-color@latest
|
||||
go-test-color -race -failfast ./...
|
||||
golangci-lint run ./...
|
||||
go install github.com/haunt98/gofimports/cmd/gofimports@latest
|
||||
go install mvdan.cc/gofumpt@latest
|
||||
gofimports -w --company github.com/make-go-great,github.com/haunt98 .
|
||||
gofumpt -w -extra .
|
||||
|
|
|
@ -125,11 +125,9 @@ func Draw(
|
|||
// Process keyStr
|
||||
if newKeyStr, ok := mapSpecialKey[keyStr]; ok {
|
||||
keyStr = newKeyStr
|
||||
} else if strings.HasPrefix(keyStr, "KC_") {
|
||||
keyStr = strings.TrimPrefix(keyStr, "KC_")
|
||||
} else if strings.HasPrefix(keyStr, "QK_") {
|
||||
keyStr = strings.TrimPrefix(keyStr, "QK_")
|
||||
}
|
||||
keyStr = strings.TrimPrefix(keyStr, "KC_")
|
||||
keyStr = strings.TrimPrefix(keyStr, "QK_")
|
||||
|
||||
// Padding to center key
|
||||
// Why / 2, why - 1 ?
|
||||
|
|
|
@ -70,7 +70,7 @@ func main() {
|
|||
|
||||
// Optional
|
||||
if filenameOut != "" {
|
||||
if err := os.WriteFile(filenameOut, []byte(result), 0o644); err != nil {
|
||||
if err := os.WriteFile(filenameOut, []byte(result), 0o600); err != nil {
|
||||
log.Fatalln("Failed to write file", filenameOut, err)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,6 +23,6 @@ type QMKKeyDictionary struct {
|
|||
|
||||
// https://config.qmk.fm/#/
|
||||
type QMKKeymap struct {
|
||||
Layers [][]string `json:"layers"`
|
||||
Layout string `json:"layout"`
|
||||
Layers [][]string `json:"layers"`
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue