Merge pull request #621 from psyomn/psyomn/add-golangci-lint-and-unused-lint
Add golangci lint and unused lint
This commit is contained in:
@@ -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
|
||||||
@@ -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
|
||||||
@@ -29,3 +29,7 @@ package_windows:
|
|||||||
|
|
||||||
package_linux:
|
package_linux:
|
||||||
fyne package -os linux -tags migrated_fynedo
|
fyne package -os linux -tags migrated_fynedo
|
||||||
|
|
||||||
|
.PHONY: lint
|
||||||
|
lint:
|
||||||
|
golangci-lint run
|
||||||
|
|||||||
@@ -31,8 +31,6 @@ const (
|
|||||||
paused = 2
|
paused = 2
|
||||||
)
|
)
|
||||||
|
|
||||||
var unimplemented = errors.New("unimplemented")
|
|
||||||
|
|
||||||
type proxyMapEntry struct {
|
type proxyMapEntry struct {
|
||||||
key string
|
key string
|
||||||
url string
|
url string
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ type JukeboxPlayer struct {
|
|||||||
curTrackDuration float64
|
curTrackDuration float64
|
||||||
startTrackTime float64
|
startTrackTime float64
|
||||||
startedAtUnixMilli int64
|
startedAtUnixMilli int64
|
||||||
nextTrackTimer *time.Timer
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (j *JukeboxPlayer) SetVolume(vol int) error {
|
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()
|
j.startedAtUnixMilli = time.Now().Add(-afterStart.Sub(beforeStart)).UnixMilli()
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (j *JukeboxPlayer) handleNextTrack() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -506,11 +506,6 @@ func (a *NowPlayingPage) Refresh() {
|
|||||||
a.BaseWidget.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) {
|
func (a *NowPlayingPage) saveSelectedTab(tabNum int) {
|
||||||
var tabName string
|
var tabName string
|
||||||
switch tabNum {
|
switch tabNum {
|
||||||
|
|||||||
@@ -9,16 +9,11 @@ import (
|
|||||||
myTheme "github.com/dweymouth/supersonic/ui/theme"
|
myTheme "github.com/dweymouth/supersonic/ui/theme"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
|
||||||
imagePopUpLowRezDim = 128
|
|
||||||
)
|
|
||||||
|
|
||||||
type ImagePopUp struct {
|
type ImagePopUp struct {
|
||||||
widget.PopUp
|
widget.PopUp
|
||||||
|
|
||||||
img image.Image
|
img image.Image
|
||||||
desiredSize fyne.Size
|
desiredSize fyne.Size
|
||||||
aspect float64
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewImagePopUp(img image.Image, canv fyne.Canvas, size fyne.Size) *ImagePopUp {
|
func NewImagePopUp(img image.Image, canv fyne.Canvas, size fyne.Size) *ImagePopUp {
|
||||||
|
|||||||
Reference in New Issue
Block a user