Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ replacements:
packages/google-cloud-containeranalysis/google/cloud/devtools/containeranalysis_v1/services/container_analysis/async_client.py,
]
before: |
from google.iam.v1 import policy_pb2 # type: ignore\n
import google.iam.v1.policy_pb2 as policy_pb2 # type: ignore\n
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The explicit \n at the end of this line is likely unnecessary. In a YAML literal block (|), newlines are already preserved. This will cause the replacement tool to search for a line ending with the literal characters \ and n before the newline, which is probably not the intention.

      import google.iam.v1.policy_pb2 as policy_pb2  # type: ignore

after: |
from google.iam.v1 import policy_pb2 # type: ignore
import google.iam.v1.policy_pb2 as policy_pb2 # type: ignore
from grafeas import grafeas_v1
from grafeas.grafeas_v1.services.grafeas import transports\n
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Similar to the before: block, the explicit \n here is likely incorrect. The literal block scalar (|) already handles the newline. This will result in adding a literal \n at the end of the line in the target file.

      from grafeas.grafeas_v1.services.grafeas import transports

count: 2
Expand Down Expand Up @@ -110,7 +110,7 @@ replacements:
- paths: [
packages/google-cloud-containeranalysis/google/cloud/devtools/containeranalysis_v1/types/containeranalysis.py
]
before: from grafeas.v1 import severity_pb2 # type: ignore
before: import grafeas.v1.severity_pb2 as severity_pb2 # type: ignore
after: import grafeas.grafeas_v1 # type: ignore
count: 1
- paths: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ replacements:
packages/google-cloud-binary-authorization/google/cloud/binaryauthorization_v1/types/service.py,
]
before: |
from grafeas.v1 import attestation_pb2 # type: ignore
import grafeas.v1.attestation_pb2 as attestation_pb2 # type: ignore
after: |
import grafeas.grafeas_v1.types # type: ignore
count: 1
Expand All @@ -37,7 +37,7 @@ replacements:
- paths: [
packages/google-cloud-policytroubleshooter-iam/google/cloud/policytroubleshooter_iam_v3/types/troubleshooter.py,
]
before: from google.iam.v2 import policy_pb2 # type: ignore
before: import google.iam.v2.policy_pb2 as policy_pb2 # type: ignore
after: from google.cloud.iam_v2 import Policy # type: ignore
count: 1
- paths: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,15 @@ replacements:
packages/google-cloud-gke-hub/tests/unit/gapic/gkehub_v1/test_gke_hub.py
]
before: |
from google.cloud.gkehub.configmanagement.v1 import configmanagement_pb2 # type: ignore
from google.cloud.gkehub.multiclusteringress.v1 import \(
multiclusteringress_pb2,
\) # type: ignore
import google.cloud.gkehub.configmanagement.v1.configmanagement_pb2 as configmanagement_pb2 # type: ignore
import google.cloud.gkehub.multiclusteringress.v1.multiclusteringress_pb2 as multiclusteringress_pb2 # type: ignore
after: ""
count: 1
- paths: [
packages/google-cloud-binary-authorization/tests/unit/gapic/binaryauthorization_v1/test_validation_helper_v1.py
]
before: |
from grafeas.v1 import attestation_pb2 # type: ignore
from grafeas.v1 import common_pb2 # type: ignore
import grafeas.v1.attestation_pb2 as attestation_pb2 # type: ignore
import grafeas.v1.common_pb2 as common_pb2 # type: ignore
after: ""
count: 1
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ replacements:
packages/google-cloud-gke-hub/google/cloud/gkehub_v1/types/feature.py
]
before: |
from google.cloud.gkehub.configmanagement.v1 import configmanagement_pb2 # type: ignore
from google.cloud.gkehub.multiclusteringress.v1 import \(
multiclusteringress_pb2,
\) # type: ignore
import google.cloud.gkehub.configmanagement.v1.configmanagement_pb2 as configmanagement_pb2 # type: ignore
import google.cloud.gkehub.multiclusteringress.v1.multiclusteringress_pb2 as multiclusteringress_pb2 # type: ignore
after: |
from google.cloud.gkehub_v1 import configmanagement_v1 # type: ignore
from google.cloud.gkehub_v1 import multiclusteringress_v1 # type: ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ replacements:
\ Returns:
\ GrafeasAsyncClient: The constructed client.
\ """
\ return GrafeasClient.from_service_account_file.__func__\(GrafeasAsyncClient, filename, \*args, \*\*kwargs\) # type: ignore
\ sa_file_func = GrafeasClient.from_service_account_file.__func__ # type: ignore
\ return sa_file_func\(GrafeasAsyncClient, filename, \*args, \*\*kwargs\)
\
\ from_service_account_json = from_service_account_file
\
Expand Down
Loading