Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/golines ci #261

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 12 additions & 2 deletions internal/collages/album.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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,
Expand Down
14 changes: 12 additions & 2 deletions internal/collages/artist.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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,
Expand Down
14 changes: 12 additions & 2 deletions internal/collages/track.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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,
Expand Down