Skip to content

Commit

Permalink
Merge pull request #284 from Monirzadeh/golangci
Browse files Browse the repository at this point in the history
add golangci-lint
  • Loading branch information
jovandeginste authored Sep 9, 2024
2 parents 8584b4c + e170e65 commit f604108
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: golangci-lint

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

permissions:
contents: read
pull-requests: read

jobs:
# Test golangci-lint for go-version define in go.mod
golangci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe #v4.1.0
with:
go-version-file: go.mod
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@a4f60bb28d35aeee14e6880718e0c85ff1882e64 # 6.0.1
with:
version: latest
only-new-issues: true
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ linters:
- dupword # Detects duplicate words.
- durationcheck
- errchkjson
- exportloopref # Detects pointers to enclosing loop variables.
- copyloopvar # Detects pointers to enclosing loop variables.
- gocritic # Metalinter; detects bugs, performance, and styling issues.
- gocyclo
- gofumpt # Detects whether code was gofumpt-ed.
Expand Down
2 changes: 1 addition & 1 deletion pkg/database/workout_met.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package database
// - https://media.hypersites.com/clients/1235/filemanager/MHC/METs.pdf
// - https://cdn-links.lww.com/permalink/mss/a/mss_43_8_2011_06_13_ainsworth_202093_sdc1.pdf

// metabolic equivalent of task
// MET returns the metabolic equivalent of task
func (w *Workout) MET() float64 {
switch {
case w.Type.IsDistance():
Expand Down

0 comments on commit f604108

Please sign in to comment.