9696_logger = logging .getLogger (__name__ )
9797
9898
99- def parse_yaml_from_file (filepath : str ) -> AnsibleBaseYAMLObject :
99+ def parse_yaml_from_file (filepath : str ) -> AnsibleBaseYAMLObject : # type: ignore[no-any-unimported]
100100 """Extract a decrypted YAML object from file."""
101101 dataloader = DataLoader ()
102102 if hasattr (dataloader , "set_vault_secrets" ):
@@ -114,7 +114,7 @@ def path_dwim(basedir: str, given: str) -> str:
114114 return str (dataloader .path_dwim (given ))
115115
116116
117- def ansible_templar (basedir : Path , templatevars : Any ) -> Templar :
117+ def ansible_templar (basedir : Path , templatevars : Any ) -> Templar : # type: ignore[no-any-unimported]
118118 """Create an Ansible Templar using templatevars."""
119119 # `basedir` is the directory containing the lintable file.
120120 # Therefore, for tasks in a role, `basedir` has the form
@@ -244,7 +244,7 @@ def tokenize(value: str) -> tuple[list[str], dict[str, str]]:
244244 return (args , kwargs )
245245
246246
247- def playbook_items (pb_data : AnsibleBaseYAMLObject ) -> ItemsView : # type: ignore[type-arg]
247+ def playbook_items (pb_data : AnsibleBaseYAMLObject ) -> ItemsView : # type: ignore[type-arg,no-any-unimported ]
248248 """Return a list of items from within the playbook."""
249249 if isinstance (pb_data , dict ):
250250 return pb_data .items ()
@@ -740,7 +740,7 @@ def task_to_str(task: dict[str, Any]) -> str:
740740
741741
742742# pylint: disable=too-many-nested-blocks
743- def extract_from_list (
743+ def extract_from_list ( # type: ignore[no-any-unimported]
744744 blocks : AnsibleBaseYAMLObject ,
745745 candidates : list [str ],
746746 * ,
@@ -913,15 +913,16 @@ def get_error_line(self, path: list[str | int]) -> int:
913913 return line
914914
915915
916- def task_in_list (
916+ def task_in_list ( # type: ignore[no-any-unimported]
917917 data : AnsibleBaseYAMLObject ,
918918 file : Lintable ,
919919 kind : str ,
920920 position : str = "." ,
921921) -> Iterator [Task ]:
922922 """Get action tasks from block structures."""
923923
924- def each_entry (data : AnsibleBaseYAMLObject , position : str ) -> Iterator [Task ]:
924+ def each_entry (data : AnsibleBaseYAMLObject , position : str ) -> Iterator [Task ]: # type: ignore[no-any-unimported]
925+
925926 if not data or not isinstance (data , Iterable ):
926927 return
927928 for entry_index , entry in enumerate (data ):
@@ -962,7 +963,7 @@ def each_entry(data: AnsibleBaseYAMLObject, position: str) -> Iterator[Task]:
962963 yield from each_entry (data , position )
963964
964965
965- def add_action_type (
966+ def add_action_type ( # type: ignore[no-any-unimported]
966967 actions : AnsibleBaseYAMLObject , action_type : str
967968) -> AnsibleSequence :
968969 """Add action markers to task objects."""
@@ -980,7 +981,7 @@ def add_action_type(
980981
981982
982983@cache
983- def parse_yaml_linenumbers (
984+ def parse_yaml_linenumbers ( # type: ignore[no-any-unimported]
984985 lintable : Lintable ,
985986) -> AnsibleBaseYAMLObject | None :
986987 """Parse yaml as ansible.utils.parse_yaml but with linenumbers.
@@ -1001,7 +1002,7 @@ def compose_node(parent: yaml.nodes.Node | None, index: int) -> yaml.nodes.Node:
10011002 return node
10021003
10031004 # signature of AnsibleConstructor.construct_mapping
1004- def construct_mapping (
1005+ def construct_mapping ( # type: ignore[no-any-unimported]
10051006 node : yaml .MappingNode ,
10061007 deep : bool = False , # noqa: FBT002
10071008 ) -> AnsibleMapping :
@@ -1183,7 +1184,7 @@ def parse_examples_from_plugin(lintable: Lintable) -> tuple[int, str]:
11831184
11841185
11851186@lru_cache
1186- def load_plugin (name : str ) -> PluginLoadContext :
1187+ def load_plugin (name : str ) -> PluginLoadContext : # type: ignore[no-any-unimported]
11871188 """Return loaded ansible plugin/module."""
11881189 loaded_module = action_loader .find_plugin_with_context (
11891190 name ,
0 commit comments