Skip to content

Commit

Permalink
chore: implement needs_project() for unimplemented commands
Browse files Browse the repository at this point in the history
Signed-off-by: Callahan Kovacs <callahan.kovacs@canonical.com>
  • Loading branch information
mr-cal committed May 8, 2024
1 parent a78dff1 commit faeee1b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions snapcraft/commands/unimplemented.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,20 @@ def run(self, parsed_args: argparse.Namespace) -> None:
# Fallback to the codepaths for non-core24-code.
raise errors.ClassicFallback()

def needs_project(
self,
parsed_args: argparse.Namespace, # noqa: ARG002 (unused argument is for subclasses)
) -> bool:
"""Property to determine if the command needs a project loaded.
Defaults to `self.always_load_project`.
:param parsed_args: Parsed arguments for the command.
:returns: True if the command needs a project loaded, False otherwise.
"""
return self.always_load_project

def run_managed(
self,
parsed_args: argparse.Namespace, # noqa: ARG002 (the unused argument is for subclasses)
Expand Down

0 comments on commit faeee1b

Please sign in to comment.