Skip to content

Commit

Permalink
Fix some issues from pylint (#3077)
Browse files Browse the repository at this point in the history
  • Loading branch information
kddejong committed Feb 26, 2024
1 parent 6e46e9d commit 94da323
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
4 changes: 2 additions & 2 deletions pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -407,8 +407,8 @@ timeout-methods=requests.api.delete,requests.api.get,requests.api.head,requests.
[EXCEPTIONS]

# Exceptions that will emit a warning when caught.
overgeneral-exceptions=BaseException,
Exception
overgeneral-exceptions=builtins.BaseException,
builtins.Exception


[REFACTORING]
Expand Down
6 changes: 2 additions & 4 deletions src/cfnlint/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,10 @@ def get_matches(filenames: str, args: cfnlint.config.ConfigMixIn) -> Iterator[Ma
args.registry_schemas,
args.mandatory_checks,
)
for match in matches:
yield match
yield from iter(matches)
else:
if errors:
for match in errors:
yield match
yield from iter(errors)
LOGGER.debug("Completed linting of file: %s", str(filename))


Expand Down
1 change: 1 addition & 0 deletions src/cfnlint/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@ def load_resource(package, filename="us-east-1.json"):
.joinpath(filename)
.read_text(encoding="utf-8")
)
# pylint: disable=W4902
return json.loads(pkg_resources.read_text(package, filename, encoding="utf-8"))


Expand Down
6 changes: 2 additions & 4 deletions src/cfnlint/template/transforms/_language_extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -502,8 +502,7 @@ def values(
)
except _ResolveError:
if self._fn.hash in collection_cache:
for item in collection_cache[self._fn.hash]:
yield item
yield from iter(collection_cache[self._fn.hash])
else:
collection_cache[self._fn.hash] = []
for _ in range(0, 2):
Expand Down Expand Up @@ -543,5 +542,4 @@ def __init__(

def items(self, cfn: Any) -> Iterable[Tuple[str, str]]:
items = self._collection.values(cfn, self._collection_cache)
for item in items:
yield item
yield from iter(items)

0 comments on commit 94da323

Please sign in to comment.