Skip to content

Commit

Permalink
ruff: Address BLE (#3368)
Browse files Browse the repository at this point in the history
  • Loading branch information
shatakshiiii authored Apr 27, 2023
1 parent a48d0bd commit fb4a00b
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,6 @@ ignore = [
"A",
"B",
"SIM",
"BLE",
"D",
"EXE",
"FBT",
Expand Down
2 changes: 1 addition & 1 deletion src/ansiblelint/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def emit(self, record: logging.LogRecord) -> None:
console_stderr.print(f"[dim]{msg}[/dim]", highlight=False)
except RecursionError: # See issue 36272
raise
except Exception: # pylint: disable=broad-exception-caught
except Exception: # pylint: disable=broad-exception-caught # noqa:BLE001
self.handleError(record)


Expand Down
2 changes: 1 addition & 1 deletion src/ansiblelint/_internal/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def getmatches(self, file: Lintable) -> list[MatchError]:
for method in [self.matchlines, self.matchtasks, self.matchyaml]:
try:
matches.extend(method(file))
except Exception as exc: # pylint: disable=broad-except
except Exception as exc: # pylint: disable=broad-except # noqa:BLE001
_logger.warning(
"Ignored exception from %s.%s while processing %s: %s",
self.__class__.__name__,
Expand Down
2 changes: 1 addition & 1 deletion src/ansiblelint/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def guess_install_method() -> str:
logging.debug("Skipping %s as it is not installed.", package_name)
use_pip = False
# pylint: disable=broad-except
except Exception as exc:
except Exception as exc: # noqa:BLE001
# On Fedora 36, we got a AttributeError exception from pip that we want to avoid
logging.debug(exc)
use_pip = False
Expand Down
2 changes: 1 addition & 1 deletion src/ansiblelint/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -999,7 +999,7 @@ def is_playbook(filename: str) -> bool:

try:
f = parse_yaml_from_file(filename)
except Exception as exc: # pylint: disable=broad-except
except Exception as exc: # pylint: disable=broad-except # noqa:BLE001
_logger.warning(
"Failed to load %s with %s, assuming is not a playbook.",
filename,
Expand Down
2 changes: 1 addition & 1 deletion src/ansiblelint/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import pkg_resources

__version__ = pkg_resources.get_distribution("ansible-lint").version
except Exception: # pylint: disable=broad-except
except Exception: # pylint: disable=broad-except # noqa:BLE001
# this is the fallback SemVer version picked by setuptools_scm when tag
# information is not available.
__version__ = "0.1.dev1"
Expand Down

0 comments on commit fb4a00b

Please sign in to comment.