Skip to content
This repository was archived by the owner on Mar 26, 2026. It is now read-only.

Commit 7d92db1

Browse files
committed
remove unnecessary fmt skips
1 parent df24f8e commit 7d92db1

9 files changed

Lines changed: 10 additions & 20 deletions

File tree

gapic/ads-templates/%namespace/%name/%version/%sub/services/%service/_shared_macros.j2

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,7 @@ def _get_http_options():
227227
request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri'])
228228
method = transcoded_request['method']
229229
{# TODO(https://github.com/googleapis/gapic-generator-python/issues/2137): Remove `type: ignore` once version check is added for google-api-core. #}
230-
{# Add `# fmt: skip` to keep `# type: ignore` on the same line #}
231-
raise core_exceptions.format_http_response_error(response, method, request_url, payload) # type: ignore # fmt: skip
230+
raise core_exceptions.format_http_response_error(response, method, request_url, payload) # type: ignore
232231
{% else %}
233232
raise core_exceptions.from_http_response(response)
234233
{% endif %}{# is_async #}

gapic/ads-templates/%namespace/%name/%version/%sub/services/%service/client.py.j2

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,7 @@ class {{ service.client_name }}(metaclass={{ service.client_name }}Meta):
131131

132132
DEFAULT_ENDPOINT = {% if service.host %}"{{ service.host }}"{% else %}None{% endif %}
133133

134-
{# Add `# fmt: skip` to keep `# type: ignore` on the same line #}
135-
DEFAULT_MTLS_ENDPOINT = _get_default_mtls_endpoint.__func__( # type: ignore # fmt: skip
134+
DEFAULT_MTLS_ENDPOINT = _get_default_mtls_endpoint.__func__( # type: ignore
136135
DEFAULT_ENDPOINT
137136
)
138137

gapic/ads-templates/%namespace/%name/%version/%sub/services/%service/transports/rest.py.j2

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,7 @@ class {{service.name}}RestTransport(_Base{{ service.name }}RestTransport):
273273
{{method.output.ident}}]:
274274
# The return type is fine, but mypy isn't sophisticated enough to determine what's going on here.
275275
# In C++ this would require a dynamic_cast
276-
{# Add `# fmt: skip` to keep `# type: ignore` on the same line #}
277-
return self._{{method.name}}(self._session, self._host, self._interceptor) # type: ignore # fmt: skip
276+
return self._{{method.name}}(self._session, self._host, self._interceptor) # type: ignore
278277

279278
{% endfor %}
280279

gapic/templates/%namespace/%name_%version/%sub/services/%service/_shared_macros.j2

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,7 @@ def _get_http_options():
257257
request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri'])
258258
method = transcoded_request['method']
259259
{# TODO(https://github.com/googleapis/gapic-generator-python/issues/2137): Remove `type: ignore` once version check is added for google-api-core. #}
260-
{# Add `# fmt: skip` to keep `# type: ignore` on the same line #}
261-
raise core_exceptions.format_http_response_error(response, method, request_url, payload) # type: ignore # fmt: skip
260+
raise core_exceptions.format_http_response_error(response, method, request_url, payload) # type: ignore
262261
{% else %}
263262
raise core_exceptions.from_http_response(response)
264263
{% endif %}{# is_async #}
@@ -490,8 +489,7 @@ class {{ async_method_name_prefix }}{{ service.name }}RestInterceptor:
490489

491490
@property
492491
def {{ name|snake_case }}(self):
493-
{# Add `# fmt: skip` to keep `# type: ignore` on the same line #}
494-
return self.{{ name|make_private }}(self._session, self._host, self._interceptor) # type: ignore # fmt: skip
492+
return self.{{ name|make_private }}(self._session, self._host, self._interceptor) # type: ignore
495493

496494
class {{ name|make_private }}(_Base{{ service.name }}RestTransport._Base{{name}}, {{ async_method_name_prefix }}{{service.name}}RestStub):
497495
def __hash__(self):

gapic/templates/%namespace/%name_%version/%sub/services/%service/async_client.py.j2

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,7 @@ class {{ service.async_client_name }}:
152152
Raises:
153153
google.auth.exceptions.MutualTLSChannelError: If any errors happen.
154154
"""
155-
{# Add `# fmt: skip` to keep `# type: ignore` on the same line #}
156-
return {{ service.client_name }}.get_mtls_endpoint_and_cert_source(client_options) # type: ignore # fmt: skip
155+
return {{ service.client_name }}.get_mtls_endpoint_and_cert_source(client_options) # type: ignore
157156

158157
@property
159158
def transport(self) -> {{ service.name }}Transport:

gapic/templates/%namespace/%name_%version/%sub/services/%service/client.py.j2

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,7 @@ class {{ service.client_name }}(metaclass={{ service.client_name }}Meta):
175175
# Note: DEFAULT_ENDPOINT is deprecated. Use _DEFAULT_ENDPOINT_TEMPLATE instead.
176176
DEFAULT_ENDPOINT = {% if service.host %}"{{ service.host }}"{% else %}None{% endif %}
177177

178-
{# Add `# fmt: skip` to keep `# type: ignore` on the same line #}
179-
DEFAULT_MTLS_ENDPOINT = _get_default_mtls_endpoint.__func__( # type: ignore # fmt: skip
178+
DEFAULT_MTLS_ENDPOINT = _get_default_mtls_endpoint.__func__( # type: ignore
180179
DEFAULT_ENDPOINT
181180
)
182181

gapic/templates/%namespace/%name_%version/%sub/services/%service/transports/rest.py.j2

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,8 +311,7 @@ class {{service.name}}RestTransport(_Base{{ service.name }}RestTransport):
311311
{{method.output.ident}}]:
312312
# The return type is fine, but mypy isn't sophisticated enough to determine what's going on here.
313313
# In C++ this would require a dynamic_cast
314-
{# Add `# fmt: skip` to keep `# type: ignore` on the same line #}
315-
return self._{{method.name}}(self._session, self._host, self._interceptor) # type: ignore # fmt: skip
314+
return self._{{method.name}}(self._session, self._host, self._interceptor) # type: ignore
316315

317316
{% endfor %}
318317

gapic/templates/%namespace/%name_%version/%sub/services/%service/transports/rest_asyncio.py.j2

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,7 @@ class Async{{service.name}}RestTransport(_Base{{ service.name }}RestTransport):
318318
def {{method.transport_safe_name|snake_case}}(self) -> Callable[
319319
[{{method.input.ident}}],
320320
{{method.output.ident}}]:
321-
{# Add `# fmt: skip` to keep `# type: ignore` on the same line #}
322-
return self._{{method.name}}(self._session, self._host, self._interceptor) # type: ignore # fmt: skip
321+
return self._{{method.name}}(self._session, self._host, self._interceptor) # type: ignore
323322

324323
{% endfor %}
325324
{% for name, sig in api.mixin_api_signatures.items() %}

gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1635,8 +1635,7 @@ def test_unsupported_parameter_rest_asyncio():
16351635
pytest.skip("the library must be installed with the `async_rest` extra to test this feature.")
16361636
options = client_options.ClientOptions(quota_project_id="octopus")
16371637
{# TODO(https://github.com/googleapis/gapic-generator-python/issues/2137): Remove `type: ignore` once we add a version check for google-api-core. #}
1638-
{# Add `# fmt: skip` to keep `# type: ignore` on the same line #}
1639-
with pytest.raises(core_exceptions.AsyncRestUnsupportedParameterError, match="google.api_core.client_options.ClientOptions.quota_project_id") as exc: # type: ignore # fmt: skip
1638+
with pytest.raises(core_exceptions.AsyncRestUnsupportedParameterError, match="google.api_core.client_options.ClientOptions.quota_project_id") as exc: # type: ignore
16401639
client = {{ get_client(service, True) }}(
16411640
credentials={{get_credentials(True)}},
16421641
transport="rest_asyncio",

0 commit comments

Comments
 (0)