From 3f249da326893ddc7b05a0e1148ad205743c7711 Mon Sep 17 00:00:00 2001 From: Kate Case Date: Wed, 19 Apr 2023 13:14:17 -0400 Subject: [PATCH] Update to match new checks --- .config/dictionary.txt | 1 + src/ansiblelint/file_utils.py | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.config/dictionary.txt b/.config/dictionary.txt index e2d196c3229..fb30b67ac94 100644 --- a/.config/dictionary.txt +++ b/.config/dictionary.txt @@ -259,6 +259,7 @@ pipx pkgcache # linux pkgs placefolder +plainexamples pluggy pluginmanager pmrun diff --git a/src/ansiblelint/file_utils.py b/src/ansiblelint/file_utils.py index 3991bc11738..c8ab17c1074 100644 --- a/src/ansiblelint/file_utils.py +++ b/src/ansiblelint/file_utils.py @@ -256,8 +256,11 @@ def __init__( _ = self.data # pylint: disable=pointless-statement if self.kind == "plugin": + # pylint: disable=consider-using-with self.file = NamedTemporaryFile( - mode="w+", suffix=f"_{name.name}.yaml", dir=self.dir + mode="w+", + suffix=f"_{name.name}.yaml", + dir=self.dir, ) self.filename = self.file.name self._content = self.parse_examples_from_plugin() @@ -267,7 +270,7 @@ def __init__( self.base_kind = "text/yaml" - def __del__(self): + def __del__(self) -> None: if hasattr(self, "file"): self.file.close()