Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prefer user signature over Hera-added overloads in @script typing #1181

Merged
merged 5 commits into from
Aug 30, 2024

Commits on Aug 29, 2024

  1. Restore docstring from decorated function

    The overload using the type signature of the decorated function had a docstring; removing it causes VS Code to pick up the docstring of the decorated function instead.
    
    Signed-off-by: Alice Purcell <alicederyn@gmail.com>
    alicederyn committed Aug 29, 2024
    Configuration menu
    Copy the full SHA
    e3e3c62 View commit details
    Browse the repository at this point in the history
  2. Reorder overload precedence

    If an invocation matches both the decorated function signature and a Hera-added signature, assume the user intended to invoke the decorated function rather than Hera. Users can always fall back to invoking the Hera constructors (e.g. `Task(template=my_function)`) directly if the type checker picks the wrong signature.
    
    Signed-off-by: Alice Purcell <alicederyn@gmail.com>
    alicederyn committed Aug 29, 2024
    Configuration menu
    Copy the full SHA
    684987c View commit details
    Browse the repository at this point in the history
  3. Small comment clarification

    Signed-off-by: Alice Purcell <alicederyn@gmail.com>
    alicederyn committed Aug 29, 2024
    Configuration menu
    Copy the full SHA
    ff6542f View commit details
    Browse the repository at this point in the history
  4. Rewrite overload docstrings

    Frame _ScriptDecoratedFunction docstrings in terms of what the call does, not what the call is.
    
    Signed-off-by: Alice Purcell <alicederyn@gmail.com>
    alicederyn committed Aug 29, 2024
    Configuration menu
    Copy the full SHA
    f7220c5 View commit details
    Browse the repository at this point in the history

Commits on Aug 30, 2024

  1. Apply suggestions from code review

    Co-authored-by: Elliot Gunton <elliotgunton@gmail.com>
    Signed-off-by: Alice Purcell <alicederyn@gmail.com>
    alicederyn and elliotgunton committed Aug 30, 2024
    Configuration menu
    Copy the full SHA
    547340b View commit details
    Browse the repository at this point in the history