Skip to content

Commit

Permalink
feat(cli/config): backport "airflow config lint"
Browse files Browse the repository at this point in the history
  • Loading branch information
Lee-W committed Jan 17, 2025
1 parent 04d0381 commit 92d296a
Show file tree
Hide file tree
Showing 3 changed files with 621 additions and 0 deletions.
34 changes: 34 additions & 0 deletions airflow/cli/cli_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -951,6 +951,28 @@ def string_lower_type(val):
help="The section name",
)

# config lint
ARG_LINT_CONFIG_SECTION = Arg(
("--section",),
help="The section name(s) to lint in the airflow config.",
type=string_list_type,
)
ARG_LINT_CONFIG_OPTION = Arg(
("--option",),
help="The option name(s) to lint in the airflow config.",
type=string_list_type,
)
ARG_LINT_CONFIG_IGNORE_SECTION = Arg(
("--ignore-section",),
help="The section name(s) to ignore to lint in the airflow config.",
type=string_list_type,
)
ARG_LINT_CONFIG_IGNORE_OPTION = Arg(
("--ignore-option",),
help="The option name(s) to ignore to lint in the airflow config.",
type=string_list_type,
)

# kubernetes cleanup-pods
ARG_NAMESPACE = Arg(
("--namespace",),
Expand Down Expand Up @@ -1869,6 +1891,18 @@ class GroupCommand(NamedTuple):
ARG_VERBOSE,
),
),
ActionCommand(
name="lint",
help="lint options for the configuration changes while migrating from Airflow 2.x to Airflow 3.0",
func=lazy_load_command("airflow.cli.commands.remote_commands.config_command.lint_config"),
args=(
ARG_LINT_CONFIG_SECTION,
ARG_LINT_CONFIG_OPTION,
ARG_LINT_CONFIG_IGNORE_SECTION,
ARG_LINT_CONFIG_IGNORE_OPTION,
ARG_VERBOSE,
),
),
)

KUBERNETES_COMMANDS = (
Expand Down
Loading

0 comments on commit 92d296a

Please sign in to comment.