Skip to content

Org-wide linter #48

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

Merged
merged 3 commits into from
Sep 10, 2024
Merged
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
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
Loading