From 426692eb9f4069d8fa14fe74accc686d6e244077 Mon Sep 17 00:00:00 2001 From: TheDen Date: Wed, 15 May 2024 19:23:44 +1000 Subject: [PATCH 1/2] ensure golines checks on the CI --- .github/workflows/ci-cd.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 191197b..9feb69a 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -84,7 +84,12 @@ jobs: - name: golines run: | go install github.com/segmentio/golines@latest - golines --write-output --ignored-dirs=vendor . + files=$(golines --ignored-dirs=vendor . --list-files) + if [ -n "${files}" ]; then + echo "The following files need reformatting:" + echo "${files}" + exit 1 + fi go-test-build: name: runner / Go Test Build From f4580ee865eaf2378fc825af4715e8b61a610b9a Mon Sep 17 00:00:00 2001 From: TheDen Date: Wed, 15 May 2024 19:25:36 +1000 Subject: [PATCH 2/2] golines fmt --- internal/collages/album.go | 14 ++++++++++++-- internal/collages/artist.go | 14 ++++++++++++-- internal/collages/track.go | 14 ++++++++++++-- 3 files changed, 36 insertions(+), 6 deletions(-) diff --git a/internal/collages/album.go b/internal/collages/album.go index b4e39b9..0b434de 100644 --- a/internal/collages/album.go +++ b/internal/collages/album.go @@ -59,7 +59,12 @@ func GetElementsForAlbum( return albums, nil } -func getLastfmAlbums(ctx context.Context, username string, period constants.Period, count int) ([]LastfmAlbum, error) { +func getLastfmAlbums( + ctx context.Context, + username string, + period constants.Period, + count int, +) ([]LastfmAlbum, error) { albums := []LastfmAlbum{} totalPages := 0 @@ -134,7 +139,12 @@ func getAlbums( return elements, nil } -func parseLastfmAlbum(ctx context.Context, album LastfmAlbum, imageSize string, cacheCount *int) Album { +func parseLastfmAlbum( + ctx context.Context, + album LastfmAlbum, + imageSize string, + cacheCount *int, +) Album { logger := zerolog.Ctx(ctx) newAlbum := Album{ Artist: album.Artist.ArtistName, diff --git a/internal/collages/artist.go b/internal/collages/artist.go index dab7623..0b22ee6 100644 --- a/internal/collages/artist.go +++ b/internal/collages/artist.go @@ -53,7 +53,12 @@ func GetElementsForArtist( return artists, nil } -func getLastfmArtists(ctx context.Context, username string, period constants.Period, count int) ([]LastfmArtist, error) { +func getLastfmArtists( + ctx context.Context, + username string, + period constants.Period, + count int, +) ([]LastfmArtist, error) { artists := []LastfmArtist{} totalPages := 0 @@ -125,7 +130,12 @@ func getArtists( return elements, nil } -func parseLastfmArtist(ctx context.Context, artist LastfmArtist, imageSize string, cacheCount *int) Artist { +func parseLastfmArtist( + ctx context.Context, + artist LastfmArtist, + imageSize string, + cacheCount *int, +) Artist { logger := zerolog.Ctx(ctx) newArtist := Artist{ Name: artist.Name, diff --git a/internal/collages/track.go b/internal/collages/track.go index 95f7147..e8b8043 100644 --- a/internal/collages/track.go +++ b/internal/collages/track.go @@ -61,7 +61,12 @@ func GetElementsForTrack( return tracks, nil } -func getLastfmTracks(ctx context.Context, username string, period constants.Period, count int) ([]LastfmTrack, error) { +func getLastfmTracks( + ctx context.Context, + username string, + period constants.Period, + count int, +) ([]LastfmTrack, error) { tracks := []LastfmTrack{} totalPages := 0 @@ -136,7 +141,12 @@ func getTracks( return elements, nil } -func parseLastfmTrack(ctx context.Context, track LastfmTrack, imageSize string, cacheCount *int) Track { +func parseLastfmTrack( + ctx context.Context, + track LastfmTrack, + imageSize string, + cacheCount *int, +) Track { logger := zerolog.Ctx(ctx) newTrack := Track{ Name: track.Name,