Skip to content
This repository has been archived by the owner on Sep 14, 2023. It is now read-only.

Commit

Permalink
chore: remove unnecessary substitutions from owlbot.py (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
suztomo authored Aug 15, 2023
1 parent 5cde43e commit f558398
Showing 1 changed file with 0 additions and 184 deletions.
184 changes: 0 additions & 184 deletions owlbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,191 +35,7 @@
if clean_up_generated_samples:
shutil.rmtree("samples/generated_samples", ignore_errors=True)
clean_up_generated_samples = False

# Apply workarounds to fix the generated docstrings.
# Issue filed upstream in https://github.com/googleapis/gapic-generator-python/issues/1345
s.replace(
library / f"google/cloud/gke_backup_{library.name}/**/*.py",
"""must:[\n]*
- be between 1 and 63 characters long
\(inclusive\) - consist of only
lower-case ASCII letters, numbers, and
dashes - start with a lower-case letter
- end with a lower-case letter or
number""",
"""must:
- be between 1 and 63 characters long (inclusive)
- consist of only lower-case ASCII letters, numbers, and dashes
- start with a lower-case letter
- end with a lower-case letter or number"""
)
s.replace(
library / f"google/cloud/gke_backup_{library.name}/**/*.py",
"""must:[\n]*
- be between 1 and 63 characters long
\(inclusive\) - consist of only lower-case ASCII
letters, numbers, and dashes - start with a
lower-case letter
- end with a lower-case letter or number
- be unique within the set of BackupPlans in
this location""",
"""must:
- be between 1 and 63 characters long (inclusive)
- consist of only lower-case ASCII letters, numbers, and dashes
- start with a lower-case letter
- end with a lower-case letter or number
- be unique within the set of BackupPlans in this location""")
s.replace(
library / f"google/cloud/gke_backup_{library.name}/**/*.py",
"""must:[\n]*
- be between 1 and 63 characters long
\(inclusive\) - consist of only lower-case ASCII
letters, numbers, and dashes - start with a
lower-case letter
- end with a lower-case letter or number
- be unique within the set of Backups in this
BackupPlan""",
"""must:
- be between 1 and 63 characters long (inclusive)
- consist of only lower-case ASCII letters, numbers, and dashes
- start with a lower-case letter
- end with a lower-case letter or number
- be unique within the set of Backups in this BackupPlan""")
s.replace(
library / f"google/cloud/gke_backup_{library.name}/**/*.py",
"""must:[\n]*
- be between 1 and 63 characters long
\(inclusive\) - consist of only lower-case ASCII
letters, numbers, and dashes - start with a
lower-case letter
- end with a lower-case letter or number
- be unique within the set of RestorePlans in
this location""",
"""must:
- be between 1 and 63 characters long (inclusive)
- consist of only lower-case ASCII letters, numbers, and dashes
- start with a lower-case letter
- end with a lower-case letter or number
- be unique within the set of RestorePlans in this location""")
s.replace(
library / f"google/cloud/gke_backup_{library.name}/**/*.py",
"""must:[\n]*
- be between 1 and 63 characters long
\(inclusive\) - consist of only lower-case ASCII
letters, numbers, and dashes - start with a
lower-case letter
- end with a lower-case letter or number
- be unique within the set of Restores in this
RestorePlan.""",
"""must:
- be between 1 and 63 characters long (inclusive)
- consist of only lower-case ASCII letters, numbers, and dashes
- start with a lower-case letter
- end with a lower-case letter or number
- be unique within the set of Restores in this RestorePlan.""")

s.replace(library / f"google/cloud/gke_backup_{library.name}/services/**/*.py",
"""be unique within the set of Backups
in this BackupPlan""",
"""be unique within the set of Backups in this BackupPlan""")
s.replace(library / f"google/cloud/gke_backup_{library.name}/services/**/*.py",
"""be unique within the set of Restores
in this RestorePlan""",
"""be unique within the set of Restores in this RestorePlan""")
s.replace(library / f"google/cloud/gke_backup_{library.name}/services/**/*.py",
"""be unique within the set of
RestorePlans in this location""",
"""be unique within the set of RestorePlans in this location""")

# workaround issue with docstrings
s.replace(
library / f"google/cloud/**/*.py",
"""projects/\\\ \*/locations/\*\n""",
"``projects/*/locations/*``\n",
)
s.replace(
library / f"google/cloud/**/*.py",
"""projects/\\\ \*/locations/\*/backupPlans/\\\\\*\n""",
"``projects/*/locations/*/backupPlans/*``\n",
)
s.replace(
library / f"google/cloud/**/*.py",
"""projects/\\\ \*/locations/\*/backupPlans/\*.\n""",
"``projects/*/locations/*/backupPlans/*``.\n",
)
s.replace(
library / f"google/cloud/**/*.py",
"""projects/\\\ \*/locations/\*/backupPlans/\*/backups/\*\n""",
"``projects/*/locations/*/backupPlans/*/backups/*``\n",
)
s.replace(
library / f"google/cloud/**/*.py",
"""projects/\\\ \*/locations/\*/backupPlans/\*/backups/\*.\n""",
"``projects/*/locations/*/backupPlans/*/backups/*``.\n",
)

s.replace(
library / f"google/cloud/**/*.py",
"projects/\\\ \*/locations/\*/backupPlans/\*/backups/\*/volumeBackups/\\\\\*\n",
"``projects/*/locations/*/backupPlans/*/backups/*/volumeBackups/*``\n",
)
s.replace(
library / f"google/cloud/**/*.py",
"projects/\\\ \*/locations/\*/backupPlans/\*/backups/\*/volumeBackups/\*.\n",
"``projects/*/locations/*/backupPlans/*/backups/*/volumeBackups/*``.\n",
)
s.replace(
library / f"google/cloud/**/*.py",
"projects/\\\ \*/locations/\*/restorePlans/\\\\\*\n",
"``projects/*/locations/*/restorePlans/*``\n",
)
s.replace(
library / f"google/cloud/**/*.py",
"projects/\\\ \*/locations/\*/restorePlans/\*.\n",
"``projects/*/locations/*/restorePlans/*``.\n",
)
s.replace(
library / f"google/cloud/**/*.py",
"projects/\\\ \*/locations/\*/restorePlans/\*/restores/\*\n",
"``projects/*/locations/*/restorePlans/*/restores/*``\n",
)
s.replace(
library / f"google/cloud/**/*.py",
"projects/\\\ \*/locations/\*/restorePlans/\*/restores/\*/volumeRestores/\\\\\*\n",
"``projects/*/locations/*/restorePlans/*/restores/*/volumeRestores/*``\n",
)
s.replace(
library / f"google/cloud/**/*.py",
"projects/\\\ \*/locations/\*/restorePlans/\*/restores/\*/volumeRestores/\*.\n",
"``projects/*/locations/*/restorePlans/*/restores/*/volumeRestores/*``.\n",
)
s.replace(
library / f"google/cloud/**/*.py",
"""- projects/\\\ \*/locations/\*/clusters/\\\\\*
- projects/\\\ \*/zones/\*/clusters/\\\\\*""",
"""- ``projects/*/locations/*/clusters/*``
- ``projects/*/zones/*/clusters/*``""",
)
s.replace(
library / f"google/cloud/**/*.py",
"""- projects/\\\ \*/locations/\*/clusters/\\\\\*
- projects/\\\ \*/zones/\*/clusters/\\\\\*""",
"""- ``projects/*/locations/*/clusters/*``
- ``projects/*/zones/*/clusters/*``""",
)
s.replace(
library / f"google/cloud/**/*.py",
"""projects/\\\ \*/locations/\*/keyRings/\*/cryptoKeys/\*""",
"""``projects/*/locations/*/keyRings/*/cryptoKeys/*``""",
)

s.move([library], excludes=["**/gapic_version.py"])

s.remove_staging_dirs()

# ----------------------------------------------------------------------------
Expand Down

0 comments on commit f558398

Please sign in to comment.