Skip to content

Commit 1736070

Browse files
committed
feat(cli/config): backport "airflow config lint"
#44908
1 parent 04d0381 commit 1736070

File tree

3 files changed

+626
-0
lines changed

3 files changed

+626
-0
lines changed

airflow/cli/cli_config.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -951,6 +951,28 @@ def string_lower_type(val):
951951
help="The section name",
952952
)
953953

954+
# config lint
955+
ARG_LINT_CONFIG_SECTION = Arg(
956+
("--section",),
957+
help="The section name(s) to lint in the airflow config.",
958+
type=string_list_type,
959+
)
960+
ARG_LINT_CONFIG_OPTION = Arg(
961+
("--option",),
962+
help="The option name(s) to lint in the airflow config.",
963+
type=string_list_type,
964+
)
965+
ARG_LINT_CONFIG_IGNORE_SECTION = Arg(
966+
("--ignore-section",),
967+
help="The section name(s) to ignore to lint in the airflow config.",
968+
type=string_list_type,
969+
)
970+
ARG_LINT_CONFIG_IGNORE_OPTION = Arg(
971+
("--ignore-option",),
972+
help="The option name(s) to ignore to lint in the airflow config.",
973+
type=string_list_type,
974+
)
975+
954976
# kubernetes cleanup-pods
955977
ARG_NAMESPACE = Arg(
956978
("--namespace",),
@@ -1869,6 +1891,18 @@ class GroupCommand(NamedTuple):
18691891
ARG_VERBOSE,
18701892
),
18711893
),
1894+
ActionCommand(
1895+
name="lint",
1896+
help="lint options for the configuration changes while migrating from Airflow 2.x to Airflow 3.0",
1897+
func=lazy_load_command("airflow.cli.commands.remote_commands.config_command.lint_config"),
1898+
args=(
1899+
ARG_LINT_CONFIG_SECTION,
1900+
ARG_LINT_CONFIG_OPTION,
1901+
ARG_LINT_CONFIG_IGNORE_SECTION,
1902+
ARG_LINT_CONFIG_IGNORE_OPTION,
1903+
ARG_VERBOSE,
1904+
),
1905+
),
18721906
)
18731907

18741908
KUBERNETES_COMMANDS = (

0 commit comments

Comments
 (0)