Skip to content

Commit

Permalink
Ensure that rule import failures are not ignored
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea committed Feb 11, 2023
1 parent d55953d commit 6c86102
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/ansiblelint/rules/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,11 +336,7 @@ def all_subclasses(cls: type) -> set[type]:
# load all modules in the directory
for f in Path(directory).glob("*.py"):
if "__" not in f.stem and f.stem not in "conftest":
try:
import_module(f"{f.stem}")

except ImportError as exc:
_logger.warning("Ignore loading rule from %s due to %s", f, exc)
import_module(f"{f.stem}")
# restore sys.path
sys.path = orig_sys_path

Expand Down

0 comments on commit 6c86102

Please sign in to comment.