Repository: kedro-org/kedro

Issue:
Deprecate `kedro lint` and `kedro test`
## Description
https://github.com/kedro-org/kedro/issues/1766

## Implementation
Deprecate `kedro lint` and `kedro test` in the same way the other development related CLI commands were deprecated in https://github.com/kedro-org/kedro/issues/1616




Discussion:

Resolving patch:
diff --git a/kedro/framework/cli/project.py b/kedro/framework/cli/project.py
--- a/kedro/framework/cli/project.py
+++ b/kedro/framework/cli/project.py
@@ -71,7 +71,14 @@ def project_group():  # pragma: no cover
 @forward_command(project_group, forward_help=True)
 @click.pass_obj  # this will pass the metadata as first argument
 def test(metadata: ProjectMetadata, args, **kwargs):  # pylint: disable=unused-argument
-    """Run the test suite."""
+    """Run the test suite. (DEPRECATED)"""
+    deprecation_message = (
+        "DeprecationWarning: Command 'kedro test' is deprecated and "
+        "will not be available from Kedro 0.19.0. "
+        "Use the command 'pytest' instead. "
+    )
+    click.secho(deprecation_message, fg="red")
+
     try:
         _check_module_importable("pytest")
     except KedroCliError as exc:
@@ -90,7 +97,13 @@ def test(metadata: ProjectMetadata, args, **kwargs):  # pylint: disable=unused-a
 def lint(
     metadata: ProjectMetadata, files, check_only, **kwargs
 ):  # pylint: disable=unused-argument
-    """Run flake8, isort and black."""
+    """Run flake8, isort and black. (DEPRECATED)"""
+    deprecation_message = (
+        "DeprecationWarning: Command 'kedro lint' is deprecated and "
+        "will not be available from Kedro 0.19.0."
+    )
+    click.secho(deprecation_message, fg="red")
+
     source_path = metadata.source_dir
     package_name = metadata.package_name
     files = files or (str(source_path / "tests"), str(source_path / package_name))
@@ -171,13 +184,15 @@ def package(metadata: ProjectMetadata):
 @click.pass_obj  # this will pass the metadata as first argument
 def build_docs(metadata: ProjectMetadata, open_docs):
     """Build the project documentation. (DEPRECATED)"""
-    source_path = metadata.source_dir
-    package_name = metadata.package_name
     deprecation_message = (
         "DeprecationWarning: Command 'kedro build-docs' is deprecated and "
         "will not be available from Kedro 0.19.0."
     )
     click.secho(deprecation_message, fg="red")
+
+    source_path = metadata.source_dir
+    package_name = metadata.package_name
+
     python_call("pip", ["install", str(source_path / "[docs]")])
     python_call("pip", ["install", "-r", str(source_path / "requirements.txt")])
     python_call("ipykernel", ["install", "--user", f"--name={package_name}"])
@@ -262,12 +277,13 @@ def activate_nbstripout(
     metadata: ProjectMetadata, **kwargs
 ):  # pylint: disable=unused-argument
     """Install the nbstripout git hook to automatically clean notebooks. (DEPRECATED)"""
-    source_path = metadata.source_dir
     deprecation_message = (
         "DeprecationWarning: Command 'kedro activate-nbstripout' is deprecated and "
         "will not be available from Kedro 0.19.0."
     )
     click.secho(deprecation_message, fg="red")
+
+    source_path = metadata.source_dir
     click.secho(
         (
             "Notebook output cells will be automatically cleared before committing"


Test patch: