Skip to content

Commit

Permalink
Merge "Improve commands doc strings" into main
Browse files Browse the repository at this point in the history
  • Loading branch information
zzzeek authored and Gerrit Code Review committed Mar 4, 2024
2 parents c14bcd6 + e0e8de1 commit d23a878
Showing 1 changed file with 24 additions and 15 deletions.
39 changes: 24 additions & 15 deletions alembic/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def init(
:param config: a :class:`.Config` object.
:param directory: string path of the target directory
:param directory: string path of the target directory.
:param template: string name of the migration environment template to
use.
Expand Down Expand Up @@ -174,7 +174,7 @@ def revision(
will be applied to the structure generated by the revision process
where it can be altered programmatically. Note that unlike all
the other parameters, this option is only available via programmatic
use of :func:`.command.revision`
use of :func:`.command.revision`.
"""

Expand Down Expand Up @@ -315,9 +315,11 @@ def merge(
:param config: a :class:`.Config` instance
:param message: string message to apply to the revision
:param revisions: The revisions to merge.
:param branch_label: string label name to apply to the new revision
:param message: string message to apply to the revision.
:param branch_label: string label name to apply to the new revision.
:param rev_id: hardcoded revision identifier instead of generating a new
one.
Expand Down Expand Up @@ -370,9 +372,10 @@ def upgrade(
:param config: a :class:`.Config` instance.
:param revision: string revision target or range for --sql mode
:param revision: string revision target or range for --sql mode. May be
``"heads"`` to target the most recent revision(s).
:param sql: if True, use ``--sql`` mode
:param sql: if True, use ``--sql`` mode.
:param tag: an arbitrary "tag" that can be intercepted by custom
``env.py`` scripts via the :meth:`.EnvironmentContext.get_tag_argument`
Expand Down Expand Up @@ -413,9 +416,10 @@ def downgrade(
:param config: a :class:`.Config` instance.
:param revision: string revision target or range for --sql mode
:param revision: string revision target or range for --sql mode. May
be ``"base"`` to target the first revision.
:param sql: if True, use ``--sql`` mode
:param sql: if True, use ``--sql`` mode.
:param tag: an arbitrary "tag" that can be intercepted by custom
``env.py`` scripts via the :meth:`.EnvironmentContext.get_tag_argument`
Expand Down Expand Up @@ -449,12 +453,13 @@ def downgrade(rev, context):
script.run_env()


def show(config, rev):
def show(config: Config, rev: str) -> None:
"""Show the revision(s) denoted by the given symbol.
:param config: a :class:`.Config` instance.
:param revision: string revision target
:param rev: string revision target. May be ``"current"`` to show the
revision(s) currently applied in the database.
"""

Expand Down Expand Up @@ -484,7 +489,7 @@ def history(
:param config: a :class:`.Config` instance.
:param rev_range: string revision range
:param rev_range: string revision range.
:param verbose: output in verbose mode.
Expand Down Expand Up @@ -543,7 +548,9 @@ def _display_current_history(rev, context):
_display_history(config, script, base, head)


def heads(config, verbose=False, resolve_dependencies=False):
def heads(
config: Config, verbose: bool = False, resolve_dependencies: bool = False
) -> None:
"""Show current available heads in the script directory.
:param config: a :class:`.Config` instance.
Expand All @@ -568,7 +575,7 @@ def heads(config, verbose=False, resolve_dependencies=False):
)


def branches(config, verbose=False):
def branches(config: Config, verbose: bool = False) -> None:
"""Show current branch points.
:param config: a :class:`.Config` instance.
Expand Down Expand Up @@ -638,7 +645,9 @@ def stamp(
:param config: a :class:`.Config` instance.
:param revision: target revision or list of revisions. May be a list
to indicate stamping of multiple branch heads.
to indicate stamping of multiple branch heads; may be ``"base"``
to remove all revisions from the table or ``"heads"`` to stamp the
most recent revision(s).
.. note:: this parameter is called "revisions" in the command line
interface.
Expand Down Expand Up @@ -728,7 +737,7 @@ def ensure_version(config: Config, sql: bool = False) -> None:
:param config: a :class:`.Config` instance.
:param sql: use ``--sql`` mode
:param sql: use ``--sql`` mode.
.. versionadded:: 1.7.6
Expand Down

0 comments on commit d23a878

Please sign in to comment.