Skip to content

Commit 4f96d6b

Browse files
committed
fix style
1 parent c48621e commit 4f96d6b

File tree

79 files changed

+55
-159
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+55
-159
lines changed

generate_protoc.py

+9-5
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ def remove_protos(rootdirpath: str):
3535
os.remove(os.path.join(root, file))
3636

3737

38-
def fiximports(rootdir: str):
39-
flake_ignore_line = "# flake8: " + "noqa" # prevent ignore the file
38+
def fix_file_contents(rootdir: str):
39+
flake_ignore_line = "# flake8: " + "noqa" # prevent ignore the file
4040

4141
for dirpath, _, fnames in os.walk(rootdir):
4242
for fname in fnames:
@@ -45,8 +45,12 @@ def fiximports(rootdir: str):
4545

4646
with open(os.path.join(dirpath, fname), 'r+t') as f:
4747
content = f.read()
48+
49+
# Fix imports
4850
content = content.replace("from protos", "from ydb._grpc.protos")
49-
content += "\n" + flake_ignore_line + "\n"
51+
52+
# Add ignore style check
53+
content = content.replace("# -*- coding: utf-8 -*-", "# -*- coding: utf-8 -*-\n" + flake_ignore_line)
5054
f.seek(0)
5155
f.write(content)
5256

@@ -59,8 +63,8 @@ def generate_protobuf(src_proto_dir: str, dst_dir: str):
5963

6064
command.build_package_protos(dst_dir)
6165
remove_protos(dst_dir)
62-
fiximports(dst_dir)
66+
fix_file_contents(dst_dir)
6367

6468

6569
if __name__ == '__main__':
66-
generate_protobuf("ydb-api-protos", "ydb/_grpc")
70+
generate_protobuf("ydb-api-protos", "ydb/_grpc")

tox.ini

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ commands =
4646
skip_install = true
4747
deps = black
4848
commands =
49-
black ydb examples tests --extend-exclude ydb/public/api
49+
black ydb examples tests --extend-exclude ydb/_grpc
5050

5151
[testenv:black]
5252
skip_install = true
5353
deps = black
5454
commands =
55-
black --check ydb examples tests --extend-exclude ydb/public/api
55+
black --check ydb examples tests --extend-exclude ydb/_grpc
5656

5757
[testenv:pylint]
5858
deps = pylint

ydb/_grpc/__init__.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +0,0 @@
1-
2-
# flake8: noqa

ydb/_grpc/protos/__init__.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +0,0 @@
1-
2-
# flake8: noqa
-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +0,0 @@
1-
2-
# flake8: noqa

ydb/_grpc/protos/annotations/validation_pb2.py

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ydb/_grpc/protos/annotations/validation_pb2_grpc.py

-2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,3 @@
22
"""Client and server classes corresponding to protobuf-defined services."""
33
import grpc
44

5-
6-
# flake8: noqa

ydb/_grpc/protos/ydb_auth_pb2.py

+1-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ydb/_grpc/protos/ydb_auth_pb2_grpc.py

-2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,3 @@
22
"""Client and server classes corresponding to protobuf-defined services."""
33
import grpc
44

5-
6-
# flake8: noqa

ydb/_grpc/protos/ydb_cms_pb2.py

+1-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ydb/_grpc/protos/ydb_cms_pb2_grpc.py

-2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,3 @@
22
"""Client and server classes corresponding to protobuf-defined services."""
33
import grpc
44

5-
6-
# flake8: noqa

ydb/_grpc/protos/ydb_common_pb2.py

+1-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ydb/_grpc/protos/ydb_common_pb2_grpc.py

-2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,3 @@
22
"""Client and server classes corresponding to protobuf-defined services."""
33
import grpc
44

5-
6-
# flake8: noqa

ydb/_grpc/protos/ydb_coordination_pb2.py

+1-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ydb/_grpc/protos/ydb_coordination_pb2_grpc.py

-2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,3 @@
22
"""Client and server classes corresponding to protobuf-defined services."""
33
import grpc
44

5-
6-
# flake8: noqa

ydb/_grpc/protos/ydb_discovery_pb2.py

+1-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ydb/_grpc/protos/ydb_discovery_pb2_grpc.py

-2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,3 @@
22
"""Client and server classes corresponding to protobuf-defined services."""
33
import grpc
44

5-
6-
# flake8: noqa

ydb/_grpc/protos/ydb_export_pb2.py

+1-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ydb/_grpc/protos/ydb_export_pb2_grpc.py

-2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,3 @@
22
"""Client and server classes corresponding to protobuf-defined services."""
33
import grpc
44

5-
6-
# flake8: noqa

ydb/_grpc/protos/ydb_formats_pb2.py

+1-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ydb/_grpc/protos/ydb_formats_pb2_grpc.py

-2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,3 @@
22
"""Client and server classes corresponding to protobuf-defined services."""
33
import grpc
44

5-
6-
# flake8: noqa

ydb/_grpc/protos/ydb_import_pb2.py

+1-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ydb/_grpc/protos/ydb_import_pb2_grpc.py

-2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,3 @@
22
"""Client and server classes corresponding to protobuf-defined services."""
33
import grpc
44

5-
6-
# flake8: noqa

ydb/_grpc/protos/ydb_issue_message_pb2.py

+1-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ydb/_grpc/protos/ydb_issue_message_pb2_grpc.py

-2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,3 @@
22
"""Client and server classes corresponding to protobuf-defined services."""
33
import grpc
44

5-
6-
# flake8: noqa

ydb/_grpc/protos/ydb_monitoring_pb2.py

+1-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ydb/_grpc/protos/ydb_monitoring_pb2_grpc.py

-2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,3 @@
22
"""Client and server classes corresponding to protobuf-defined services."""
33
import grpc
44

5-
6-
# flake8: noqa

ydb/_grpc/protos/ydb_operation_pb2.py

+1-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ydb/_grpc/protos/ydb_operation_pb2_grpc.py

-2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,3 @@
22
"""Client and server classes corresponding to protobuf-defined services."""
33
import grpc
44

5-
6-
# flake8: noqa

ydb/_grpc/protos/ydb_persqueue_cluster_discovery_pb2.py

+1-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ydb/_grpc/protos/ydb_persqueue_cluster_discovery_pb2_grpc.py

-2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,3 @@
22
"""Client and server classes corresponding to protobuf-defined services."""
33
import grpc
44

5-
6-
# flake8: noqa

ydb/_grpc/protos/ydb_persqueue_v1_pb2.py

+1-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ydb/_grpc/protos/ydb_persqueue_v1_pb2_grpc.py

-2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,3 @@
22
"""Client and server classes corresponding to protobuf-defined services."""
33
import grpc
44

5-
6-
# flake8: noqa

ydb/_grpc/protos/ydb_query_stats_pb2.py

+1-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ydb/_grpc/protos/ydb_query_stats_pb2_grpc.py

-2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,3 @@
22
"""Client and server classes corresponding to protobuf-defined services."""
33
import grpc
44

5-
6-
# flake8: noqa

ydb/_grpc/protos/ydb_rate_limiter_pb2.py

+1-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ydb/_grpc/protos/ydb_rate_limiter_pb2_grpc.py

-2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,3 @@
22
"""Client and server classes corresponding to protobuf-defined services."""
33
import grpc
44

5-
6-
# flake8: noqa

ydb/_grpc/protos/ydb_scheme_pb2.py

+1-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ydb/_grpc/protos/ydb_scheme_pb2_grpc.py

-2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,3 @@
22
"""Client and server classes corresponding to protobuf-defined services."""
33
import grpc
44

5-
6-
# flake8: noqa

ydb/_grpc/protos/ydb_scripting_pb2.py

+1-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ydb/_grpc/protos/ydb_scripting_pb2_grpc.py

-2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,3 @@
22
"""Client and server classes corresponding to protobuf-defined services."""
33
import grpc
44

5-
6-
# flake8: noqa

ydb/_grpc/protos/ydb_status_codes_pb2.py

+1-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ydb/_grpc/protos/ydb_status_codes_pb2_grpc.py

-2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,3 @@
22
"""Client and server classes corresponding to protobuf-defined services."""
33
import grpc
44

5-
6-
# flake8: noqa

0 commit comments

Comments
 (0)