Merge pull request #621 from psyomn/psyomn/add-golangci-lint-and-unused-lint

Add golangci lint and unused lint
This commit is contained in:
Drew Weymouth
2025-05-18 13:41:58 -07:00
committed by GitHub
7 changed files with 79 additions and 17 deletions
+27
View File
@@ -0,0 +1,27 @@
# https://github.com/marketplace/actions/golangci-lint
name: golangci-lint
on:
push:
branches:
pull_request:
permissions:
contents: read
# Optional: allow read access to pull request. Use with `only-new-issues` option.
pull-requests: read
jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: stable
- name: Install dependencies
run: sudo apt update && sudo apt install libmpv-dev gcc libegl1-mesa-dev xorg-dev
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.64
+48
View File
@@ -0,0 +1,48 @@
run:
go: "1.21"
issues-exit-code: 1
tests: true
timeout: 10m
linters:
enable:
- unused
disable:
- asasalint
- asciicheck
- bidichk
- bodyclose
- contextcheck
- durationcheck
- errcheck
- errchkjson
- errorlint
- exhaustive
- gocheckcompilerdirectives
- gochecksumtype
- gosec
- gosmopolitan
- govet
- loggercheck
- makezero
- musttag
- nilerr
- nilnesserr
- noctx
- protogetter
- reassign
- recvcheck
- rowserrcheck
- spancheck
- sqlclosecheck
- staticcheck
- testifylint
- unparam
- zerologlint
presets:
- bugs
- unused
fast: false
linters-settings:
gofmt:
simplify: true
+4
View File
@@ -29,3 +29,7 @@ package_windows:
package_linux:
fyne package -os linux -tags migrated_fynedo
.PHONY: lint
lint:
golangci-lint run
-2
View File
@@ -31,8 +31,6 @@ const (
paused = 2
)
var unimplemented = errors.New("unimplemented")
type proxyMapEntry struct {
key string
url string
-5
View File
@@ -27,7 +27,6 @@ type JukeboxPlayer struct {
curTrackDuration float64
startTrackTime float64
startedAtUnixMilli int64
nextTrackTimer *time.Timer
}
func (j *JukeboxPlayer) SetVolume(vol int) error {
@@ -154,7 +153,3 @@ func (j *JukeboxPlayer) startAndUpdateTime() error {
j.startedAtUnixMilli = time.Now().Add(-afterStart.Sub(beforeStart)).UnixMilli()
return nil
}
func (j *JukeboxPlayer) handleNextTrack() {
}
-5
View File
@@ -506,11 +506,6 @@ func (a *NowPlayingPage) Refresh() {
a.BaseWidget.Refresh()
}
func (a *NowPlayingPage) doSetNewTrackOrder(idxs []int, insertPos int) {
newTracks := sharedutil.ReorderItems(a.queue, idxs, insertPos)
a.pm.UpdatePlayQueue(newTracks)
}
func (a *NowPlayingPage) saveSelectedTab(tabNum int) {
var tabName string
switch tabNum {
-5
View File
@@ -9,16 +9,11 @@ import (
myTheme "github.com/dweymouth/supersonic/ui/theme"
)
const (
imagePopUpLowRezDim = 128
)
type ImagePopUp struct {
widget.PopUp
img image.Image
desiredSize fyne.Size
aspect float64
}
func NewImagePopUp(img image.Image, canv fyne.Canvas, size fyne.Size) *ImagePopUp {