Fix a blanket type ignore comment (#3258)

This commit allows the ignore-without-code mypy warning to be
enabled. It also allows the pygrep-hooks ruff rules to be enabled.
This commit is contained in:
correctmost 2025-03-13 18:06:36 -04:00 committed by GitHub
parent b6983a2d5a
commit 4938d79873
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View File

@ -168,7 +168,7 @@ class ProfileHandler:
self._profiles = [p for p in self.profiles if p.name not in remove_names]
def get_profile_by_name(self, name: str) -> Profile | None:
return next(filter(lambda x: x.name == name, self.profiles), None) # type: ignore
return next(filter(lambda x: x.name == name, self.profiles), None) # type: ignore[arg-type, union-attr]
def get_top_level_profiles(self) -> list[Profile]:
return [p for p in self.profiles if p.is_top_level_profile()]

View File

@ -71,6 +71,7 @@ disallow_any_expr = false
disallow_any_unimported = true
enable_error_code = [
"explicit-override",
"ignore-without-code",
"mutable-override",
"redundant-expr",
"redundant-self",
@ -192,6 +193,7 @@ select = [
"ICN", # flake8-import-conventions
"ISC", # flake8-implicit-str-concat
"LOG", # flake8-logging
"PGH", # pygrep-hooks
"PIE", # flake8-pie
"PLC", # Pylint conventions
"PLE", # Pylint errors