Skip to content

Commit

Permalink
Merge pull request #13 from madflojo/fix-lint-action
Browse files Browse the repository at this point in the history
ci(lint): fix linter for multi-module repo
  • Loading branch information
madflojo authored Apr 7, 2024
2 parents 2e99061 + 2dac406 commit 1a82646
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 10 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ jobs:
golangci:
name: golangci
runs-on: ubuntu-latest
strategy:
matrix:
modules: [ ".", "./functions/src/data/init", "./functions/src/data/fetch", "./functions/src/data/load", "./functions/src/handlers/lookup"]
steps:
- uses: actions/setup-go@v3
with:
Expand All @@ -23,7 +26,7 @@ jobs:
version: latest

# Optional: working directory, useful for monorepos
# working-directory: somedir
working-directory: ${{ matrix.modules }}

# Optional: golangci-lint command line arguments.
args: -E misspell -E revive -E bodyclose -E errname -E gofmt --timeout=5m
Expand Down
1 change: 1 addition & 0 deletions functions/src/data/fetch/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package main

import (
"fmt"

"github.com/tarmac-project/tarmac/pkg/sdk"
)

Expand Down
1 change: 1 addition & 0 deletions functions/src/data/init/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package main

import (
"fmt"

"github.com/tarmac-project/tarmac/pkg/sdk"
)

Expand Down
7 changes: 4 additions & 3 deletions functions/src/data/load/main.go
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
/*
The purpose of this function is to download the CSV data (by calling another function), parse it, enrich the data, and
The purpose of this function is to download the CSV data (by calling another function), parse it, enrich the data, and
load the contents within the SQL database.
This function is called multiple times throughout the application. It's called by an "init" function and also set
This function is called multiple times throughout the application. It's called by an "init" function and also set
as a scheduled task by itself.
*/
package main

import (
"bytes"
"fmt"
"html"

"github.com/tarmac-project/example-airport-lookup-go/pkg/airport/parsers/csv"
"github.com/tarmac-project/tarmac/pkg/sdk"
"html"
)

type Function struct {
Expand Down
7 changes: 4 additions & 3 deletions functions/src/handlers/lookup/main.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
/*
This function is a lookup request handler function. When a request is received, this function is called and will parse
the incoming request, look up the requested airport from the cache, on cache miss, find the requested data in the
This function is a lookup request handler function. When a request is received, this function is called and will parse
the incoming request, look up the requested airport from the cache, on cache miss, find the requested data in the
database, and provide it back as a response to the request.
*/
package main

import (
"encoding/base64"
"fmt"
"html"

"github.com/tarmac-project/tarmac/pkg/sdk"
"github.com/valyala/fastjson"
"html"
)

// Function is the main function object that will be initialized
Expand Down
1 change: 1 addition & 0 deletions pkg/airport/airport.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package airport

import (
"fmt"

"github.com/enescakir/emoji"
)

Expand Down
3 changes: 2 additions & 1 deletion pkg/airport/parsers/csv/csv.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ package csv
import (
"encoding/csv"
"fmt"
"github.com/tarmac-project/example-airport-lookup-go/pkg/airport"
"io"

"github.com/tarmac-project/example-airport-lookup-go/pkg/airport"
)

var (
Expand Down
5 changes: 3 additions & 2 deletions pkg/airport/parsers/csv/csv_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package csv

import (
"bytes"
"github.com/enescakir/emoji"
"github.com/tarmac-project/example-airport-lookup-go/pkg/airport"
"reflect"
"testing"

"github.com/enescakir/emoji"
"github.com/tarmac-project/example-airport-lookup-go/pkg/airport"
)

type RecordToAirportTestCase struct {
Expand Down

0 comments on commit 1a82646

Please sign in to comment.