From e477c67852834a5bb8c22dec498d580a6421a3ea Mon Sep 17 00:00:00 2001 From: Avasam Date: Sun, 22 Oct 2023 20:22:55 -0400 Subject: [PATCH] Check `*_pb2.pyi` files again (#10909) --- .flake8 | 6 ++---- pyproject.toml | 2 -- .../s2clientprotocol/data_pb2.pyi | 4 ++-- .../s2clientprotocol/debug_pb2.pyi | 6 +++--- .../s2clientprotocol/sc2api_pb2.pyi | 16 ++++++++-------- .../s2clientprotocol/score_pb2.pyi | 2 +- .../s2clientprotocol/spatial_pb2.pyi | 2 +- .../s2clientprotocol/s2clientprotocol/ui_pb2.pyi | 6 +++--- 8 files changed, 20 insertions(+), 24 deletions(-) diff --git a/.flake8 b/.flake8 index 879aa915b..1ef9bf9a5 100644 --- a/.flake8 +++ b/.flake8 @@ -37,9 +37,7 @@ per-file-ignores = # F811 redefinition of unused '...' stdlib/typing.pyi: B, E701, E741, F401, F403, F405, F811 # Generated protobuf files include docstrings - # *_pb2.pyi: B, E701, E741, F401, F403, F405, Y021, Y026, Y053, Y054 + *_pb2.pyi: B, E701, E741, F401, F403, F405, Y021, Y026, Y053, Y054 -# TODO: Re-enable Flake8 on generated protobuf files -# after https://github.com/nipunn1313/mypy-protobuf/issues/523 is resolved -exclude = .venv*,.git,*_pb2.pyi +exclude = .venv*,.git noqa_require_code = true diff --git a/pyproject.toml b/pyproject.toml index 6a7ae3e93..d40bad4b1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -64,8 +64,6 @@ line-length = 130 target-version = "py37" fix = true exclude = [ - # Ignore generated protobuf stubs - "*_pb2.pyi", # virtual environment ".env", ".venv", diff --git a/stubs/s2clientprotocol/s2clientprotocol/data_pb2.pyi b/stubs/s2clientprotocol/s2clientprotocol/data_pb2.pyi index cd9ded47d..d53937df2 100644 --- a/stubs/s2clientprotocol/s2clientprotocol/data_pb2.pyi +++ b/stubs/s2clientprotocol/s2clientprotocol/data_pb2.pyi @@ -66,7 +66,7 @@ class AbilityData(google.protobuf.message.Message): ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType - class _TargetEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[AbilityData._Target.ValueType], builtins.type): # noqa: F821 + class _TargetEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[AbilityData._Target.ValueType], builtins.type): DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor Point: AbilityData._Target.ValueType # 2 """Requires a target position.""" @@ -183,7 +183,7 @@ class Weapon(google.protobuf.message.Message): ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType - class _TargetTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[Weapon._TargetType.ValueType], builtins.type): # noqa: F821 + class _TargetTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[Weapon._TargetType.ValueType], builtins.type): DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor Ground: Weapon._TargetType.ValueType # 1 Air: Weapon._TargetType.ValueType # 2 diff --git a/stubs/s2clientprotocol/s2clientprotocol/debug_pb2.pyi b/stubs/s2clientprotocol/s2clientprotocol/debug_pb2.pyi index 77441ec37..5f605f930 100644 --- a/stubs/s2clientprotocol/s2clientprotocol/debug_pb2.pyi +++ b/stubs/s2clientprotocol/s2clientprotocol/debug_pb2.pyi @@ -337,7 +337,7 @@ class DebugTestProcess(google.protobuf.message.Message): ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType - class _TestEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[DebugTestProcess._Test.ValueType], builtins.type): # noqa: F821 + class _TestEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[DebugTestProcess._Test.ValueType], builtins.type): DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor hang: DebugTestProcess._Test.ValueType # 1 crash: DebugTestProcess._Test.ValueType # 2 @@ -387,7 +387,7 @@ class DebugEndGame(google.protobuf.message.Message): ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType - class _EndResultEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[DebugEndGame._EndResult.ValueType], builtins.type): # noqa: F821 + class _EndResultEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[DebugEndGame._EndResult.ValueType], builtins.type): DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor Surrender: DebugEndGame._EndResult.ValueType # 1 """Default if nothing is set. The current player admits defeat.""" @@ -418,7 +418,7 @@ class DebugSetUnitValue(google.protobuf.message.Message): ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType - class _UnitValueEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[DebugSetUnitValue._UnitValue.ValueType], builtins.type): # noqa: F821 + class _UnitValueEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[DebugSetUnitValue._UnitValue.ValueType], builtins.type): DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor Energy: DebugSetUnitValue._UnitValue.ValueType # 1 Life: DebugSetUnitValue._UnitValue.ValueType # 2 diff --git a/stubs/s2clientprotocol/s2clientprotocol/sc2api_pb2.pyi b/stubs/s2clientprotocol/s2clientprotocol/sc2api_pb2.pyi index 23c69ca1f..c3b879600 100644 --- a/stubs/s2clientprotocol/s2clientprotocol/sc2api_pb2.pyi +++ b/stubs/s2clientprotocol/s2clientprotocol/sc2api_pb2.pyi @@ -542,7 +542,7 @@ class ResponseCreateGame(google.protobuf.message.Message): ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType - class _ErrorEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ResponseCreateGame._Error.ValueType], builtins.type): # noqa: F821 + class _ErrorEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ResponseCreateGame._Error.ValueType], builtins.type): DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor MissingMap: ResponseCreateGame._Error.ValueType # 1 InvalidMapPath: ResponseCreateGame._Error.ValueType # 2 @@ -664,7 +664,7 @@ class ResponseJoinGame(google.protobuf.message.Message): ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType - class _ErrorEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ResponseJoinGame._Error.ValueType], builtins.type): # noqa: F821 + class _ErrorEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ResponseJoinGame._Error.ValueType], builtins.type): DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor MissingParticipation: ResponseJoinGame._Error.ValueType # 1 InvalidObservedPlayerId: ResponseJoinGame._Error.ValueType # 2 @@ -741,7 +741,7 @@ class ResponseRestartGame(google.protobuf.message.Message): ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType - class _ErrorEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ResponseRestartGame._Error.ValueType], builtins.type): # noqa: F821 + class _ErrorEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ResponseRestartGame._Error.ValueType], builtins.type): DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor LaunchError: ResponseRestartGame._Error.ValueType # 1 @@ -818,7 +818,7 @@ class ResponseStartReplay(google.protobuf.message.Message): ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType - class _ErrorEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ResponseStartReplay._Error.ValueType], builtins.type): # noqa: F821 + class _ErrorEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ResponseStartReplay._Error.ValueType], builtins.type): DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor MissingReplay: ResponseStartReplay._Error.ValueType # 1 InvalidReplayPath: ResponseStartReplay._Error.ValueType # 2 @@ -878,7 +878,7 @@ class ResponseMapCommand(google.protobuf.message.Message): ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType - class _ErrorEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ResponseMapCommand._Error.ValueType], builtins.type): # noqa: F821 + class _ErrorEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ResponseMapCommand._Error.ValueType], builtins.type): DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor NoTriggerError: ResponseMapCommand._Error.ValueType # 1 @@ -1371,7 +1371,7 @@ class ResponseReplayInfo(google.protobuf.message.Message): ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType - class _ErrorEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ResponseReplayInfo._Error.ValueType], builtins.type): # noqa: F821 + class _ErrorEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ResponseReplayInfo._Error.ValueType], builtins.type): DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor MissingReplay: ResponseReplayInfo._Error.ValueType # 1 InvalidReplayPath: ResponseReplayInfo._Error.ValueType # 2 @@ -1501,7 +1501,7 @@ class ResponseSaveMap(google.protobuf.message.Message): ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType - class _ErrorEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ResponseSaveMap._Error.ValueType], builtins.type): # noqa: F821 + class _ErrorEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ResponseSaveMap._Error.ValueType], builtins.type): DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor InvalidMapData: ResponseSaveMap._Error.ValueType # 1 @@ -1897,7 +1897,7 @@ class ActionChat(google.protobuf.message.Message): ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType - class _ChannelEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ActionChat._Channel.ValueType], builtins.type): # noqa: F821 + class _ChannelEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ActionChat._Channel.ValueType], builtins.type): DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor Broadcast: ActionChat._Channel.ValueType # 1 Team: ActionChat._Channel.ValueType # 2 diff --git a/stubs/s2clientprotocol/s2clientprotocol/score_pb2.pyi b/stubs/s2clientprotocol/s2clientprotocol/score_pb2.pyi index 78549038d..a1c5360f3 100644 --- a/stubs/s2clientprotocol/s2clientprotocol/score_pb2.pyi +++ b/stubs/s2clientprotocol/s2clientprotocol/score_pb2.pyi @@ -24,7 +24,7 @@ class Score(google.protobuf.message.Message): ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType - class _ScoreTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[Score._ScoreType.ValueType], builtins.type): # noqa: F821 + class _ScoreTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[Score._ScoreType.ValueType], builtins.type): DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor Curriculum: Score._ScoreType.ValueType # 1 """map generated score (from curriculum maps with special scoring)""" diff --git a/stubs/s2clientprotocol/s2clientprotocol/spatial_pb2.pyi b/stubs/s2clientprotocol/s2clientprotocol/spatial_pb2.pyi index 1e2559038..5105e79a6 100644 --- a/stubs/s2clientprotocol/s2clientprotocol/spatial_pb2.pyi +++ b/stubs/s2clientprotocol/s2clientprotocol/spatial_pb2.pyi @@ -376,7 +376,7 @@ class ActionSpatialUnitSelectionPoint(google.protobuf.message.Message): ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType - class _TypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ActionSpatialUnitSelectionPoint._Type.ValueType], builtins.type): # noqa: F821 + class _TypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ActionSpatialUnitSelectionPoint._Type.ValueType], builtins.type): DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor Select: ActionSpatialUnitSelectionPoint._Type.ValueType # 1 """Equivalent to normal click. Changes selection to unit.""" diff --git a/stubs/s2clientprotocol/s2clientprotocol/ui_pb2.pyi b/stubs/s2clientprotocol/s2clientprotocol/ui_pb2.pyi index 9490cde97..480c49603 100644 --- a/stubs/s2clientprotocol/s2clientprotocol/ui_pb2.pyi +++ b/stubs/s2clientprotocol/s2clientprotocol/ui_pb2.pyi @@ -307,7 +307,7 @@ class ActionControlGroup(google.protobuf.message.Message): ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType - class _ControlGroupActionEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ActionControlGroup._ControlGroupAction.ValueType], builtins.type): # noqa: F821 + class _ControlGroupActionEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ActionControlGroup._ControlGroupAction.ValueType], builtins.type): DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor Recall: ActionControlGroup._ControlGroupAction.ValueType # 1 """Equivalent to number hotkey. Replaces current selection with control group.""" @@ -397,7 +397,7 @@ class ActionSelectIdleWorker(google.protobuf.message.Message): ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType - class _TypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ActionSelectIdleWorker._Type.ValueType], builtins.type): # noqa: F821 + class _TypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ActionSelectIdleWorker._Type.ValueType], builtins.type): DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor Set: ActionSelectIdleWorker._Type.ValueType # 1 """Equivalent to click with no modifiers. Replaces selection with single idle worker.""" @@ -438,7 +438,7 @@ class ActionMultiPanel(google.protobuf.message.Message): ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType - class _TypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ActionMultiPanel._Type.ValueType], builtins.type): # noqa: F821 + class _TypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ActionMultiPanel._Type.ValueType], builtins.type): DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor SingleSelect: ActionMultiPanel._Type.ValueType # 1 """Click on icon"""