Skip to content

Commit 82578ac

Browse files
committed
skip check format of autogenerated files
1 parent 39a6773 commit 82578ac

File tree

13 files changed

+32
-115
lines changed

13 files changed

+32
-115
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env bash
2+
3+
set -eu
4+
5+
DIR="$1"
6+
7+
cd "$DIR"
8+
9+
export PATH="$(go env GOPATH)/bin:$PATH"
10+
for FILE in $(find . -name '*.go'); do
11+
if [ "YES" == "$(bash ./.github/scripts/is_autogenerated_file.sh "$FILE")" ]; then
12+
echo "Skip autogenerated file: $FILE" >&2
13+
continue
14+
fi
15+
16+
bash ./.github/scripts/format-go-code.sh "$FILE"
17+
done
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env bash
2+
3+
FILEPATH="$1"
4+
5+
grep -q "Code generated by gtrace. DO NOT EDIT." "$FILEPATH" && echo YES && exit 0
6+
grep -q "Code generated by MockGen. DO NOT EDIT." "$FILEPATH" && echo YES && exit 0
7+
8+
echo NO
9+
exit 0

.github/workflows/lint.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,7 @@ jobs:
3939
go install github.com/rinchsan/gosimports/cmd/[email protected]
4040
4141
- name: format all files with auto-formatter
42-
run: |
43-
export PATH="$(go env GOPATH)/bin:$PATH"
44-
for FILE in $(find . -name '*.go'); do
45-
bash ./.github/scripts/format-go-code.sh "$FILE"
46-
done
42+
run: bash ./.github/scripts/format-all-go-code.sh "$PWD"
4743

4844
- name: Check repository diff
4945
run: bash ./.github/scripts/check-work-copy-equals-to-committed.sh "auto-format broken"

internal/topic/topicclientinternal/client.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@ package topicclientinternal
33
import (
44
"context"
55

6-
"google.golang.org/grpc"
7-
86
"github.com/ydb-platform/ydb-go-genproto/Ydb_Topic_V1"
7+
"google.golang.org/grpc"
98

109
"github.com/ydb-platform/ydb-go-sdk/v3/internal/grpcwrapper/rawtopic"
1110
"github.com/ydb-platform/ydb-go-sdk/v3/internal/grpcwrapper/rawtopic/rawtopiccommon"

internal/topic/topicreaderinternal/batcher_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,9 @@ import (
99

1010
"github.com/stretchr/testify/require"
1111

12-
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xtest"
13-
1412
"github.com/ydb-platform/ydb-go-sdk/v3/internal/empty"
1513
"github.com/ydb-platform/ydb-go-sdk/v3/internal/grpcwrapper/rawtopic/rawtopicreader"
14+
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xtest"
1615
)
1716

1817
func TestBatcher_PushBatch(t *testing.T) {

internal/topic/topicreaderinternal/committer_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,10 @@ import (
99
"github.com/jonboulle/clockwork"
1010
"github.com/stretchr/testify/require"
1111

12-
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xtest"
13-
1412
"github.com/ydb-platform/ydb-go-sdk/v3/internal/empty"
1513
"github.com/ydb-platform/ydb-go-sdk/v3/internal/grpcwrapper/rawtopic/rawtopicreader"
1614
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xcontext"
15+
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xtest"
1716
)
1817

1918
func TestCommitterCommit(t *testing.T) {

internal/topic/topicreaderinternal/stream_reader_impl_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,14 @@ import (
1515
"github.com/golang/mock/gomock"
1616
"github.com/stretchr/testify/require"
1717

18-
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xtest"
19-
2018
"github.com/ydb-platform/ydb-go-sdk/v3/internal/empty"
2119
"github.com/ydb-platform/ydb-go-sdk/v3/internal/grpcwrapper/rawtopic/rawtopiccommon"
2220
"github.com/ydb-platform/ydb-go-sdk/v3/internal/grpcwrapper/rawtopic/rawtopicreader"
2321
"github.com/ydb-platform/ydb-go-sdk/v3/internal/grpcwrapper/rawydb"
2422
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xcontext"
2523
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xerrors"
2624
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xsync"
25+
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xtest"
2726
"github.com/ydb-platform/ydb-go-sdk/v3/trace"
2827
)
2928

internal/topic/topicreaderinternal/stream_reconnector_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,10 @@ import (
99
"github.com/golang/mock/gomock"
1010
"github.com/stretchr/testify/require"
1111

12-
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xtest"
13-
1412
"github.com/ydb-platform/ydb-go-sdk/v3/internal/background"
1513
"github.com/ydb-platform/ydb-go-sdk/v3/internal/empty"
1614
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xerrors"
15+
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xtest"
1716
)
1817

1918
var _ batchedStreamReader = &readerReconnector{} // check interface implementation

trace/discovery_gtrace.go

Lines changed: 0 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)