Skip to content
This repository has been archived by the owner on Dec 23, 2024. It is now read-only.

Commit

Permalink
init/linter: add linter to github workflow jobs (#49)
Browse files Browse the repository at this point in the history
* init/linter: add linter to github workflow jobs and fix lint for provider

---------

Co-authored-by: Maksim Konovalov <maksim.konovalov@vk.team>
  • Loading branch information
KaymeKaydex and Maksim Konovalov authored Aug 26, 2024
1 parent 1bf4c27 commit c3e9913
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
23 changes: 22 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,25 @@ jobs:
uses: codecov/codecov-action@v4.0.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: KaymeKaydex/go-vshard-router
slug: KaymeKaydex/go-vshard-router

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v2

- uses: actions/checkout@v2

- name: golangci-lint
uses: golangci/golangci-lint-action@v3
continue-on-error: true
with:
# The first run is for GitHub Actions error format.
args: --config=.golangci.yaml

- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
# The second run is for human-readable error format with a file name
# and a line number.
args: --out-${NO_FUTURE}format colored-line-number --config=.golangci.yaml
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ FEATURES:

* Added etcd v2 topology provider implementation (#16)
* Add TopologyController mock for testing improve
* Add linter job (#33)

REFACTOR:

* Refactored docs (add QuickStart doc) and that library base on vhsard router
* Several linters are enabled because they are usefull
* Ignore .tmp files
* Refactored provider creation test caused by golang-ci lint (#33)



Expand Down
3 changes: 2 additions & 1 deletion providers/static/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ func TestNewProvider(t *testing.T) {

for _, tc := range tCases {
t.Run("provider", func(t *testing.T) {
if tc.Source == nil || len(tc.Source) == 0 {
if len(tc.Source) == 0 {

require.Panics(t, func() {
NewProvider(tc.Source)
})
Expand Down

0 comments on commit c3e9913

Please sign in to comment.