Skip to content

Commit

Permalink
Org-wide linter (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
roman-khimov authored Sep 10, 2024
2 parents 845edb1 + 30cb40d commit b0d8d02
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 89 deletions.
26 changes: 0 additions & 26 deletions .github/workflows/golangci-lint.yml

This file was deleted.

4 changes: 4 additions & 0 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ on:
workflow_dispatch:

jobs:
lint:
name: Linter
uses: nspcc-dev/.github/.github/workflows/go-linter.yml@master

test_cover:
name: Coverage
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ in/
locode_db
*.csv
!override.csv
.golangci.yml
59 changes: 0 additions & 59 deletions .golangci.yml

This file was deleted.

9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ VERSION ?= "$(shell git describe --tags --match "v*" --dirty --always --abbrev=8
LOCODEDB ?= pkg/locodedb/data
UNLOCODEREVISION = 600bdf54c4777a7328123d16166b1f8bbc7ee359

.PHONY: all clean version help generate
.PHONY: all clean version help generate lint

DIRS = in ${LOCODEDB}

Expand Down Expand Up @@ -53,6 +53,13 @@ compress_locodedb: generate
fi \
done

.golangci.yml:
wget -O $@ https://github.com/nspcc-dev/.github/raw/master/.golangci.yml

# Lint Go code
lint: .golangci.yml
golangci-lint run

# Print version
version:
@echo $(VERSION)
Expand Down
1 change: 0 additions & 1 deletion pkg/locodedb/calls_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,5 @@ func TestGet(t *testing.T) {
t.Run("valid key", func(t *testing.T) {
_, err := locodedb.NewKey("RU", "MOW")
require.NoError(t, err)

})
}
4 changes: 2 additions & 2 deletions pkg/locodedb/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func unpackCountriesData(data []byte) (map[CountryCode]countryData, error) {

for {
record, err := reader.Read()
if err == io.EOF {
if errors.Is(err, io.EOF) {
break
} else if err != nil {
return m, err
Expand All @@ -84,7 +84,7 @@ func unpackLocodesData(data []byte, mc map[CountryCode]countryData) (string, err

for {
record, err := reader.Read()
if err == io.EOF {
if errors.Is(err, io.EOF) {
break
} else if err != nil {
return "", err
Expand Down

0 comments on commit b0d8d02

Please sign in to comment.