Skip to content

Commit cb5489d

Browse files
committed
Fix typings
1 parent 6ccf6bc commit cb5489d

File tree

5 files changed

+8
-6
lines changed

5 files changed

+8
-6
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
### Unreleased
44

5+
### 0.5.0
6+
57
- Fix ignore_checks
68
- Skip models fields not inherited from fields.Field
79
- Add ignore_types option

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = django-extra-checks
3-
version = 0.4.1
3+
version = 0.5.0
44
author = Konstantin Alekseev
55
author_email = [email protected]
66
description = Collection of useful checks for Django Checks Framework

src/extra_checks/checks/base_checks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def __init__(
2323
self,
2424
level: Optional[int] = None,
2525
ignore_objects: Optional[Set[Any]] = None,
26-
ignore_types: Optional[Set[str]] = None,
26+
ignore_types: Optional[set] = None,
2727
) -> None:
2828
self.level = level or self.level
2929
self.ignore_objects = ignore_objects or set()

src/extra_checks/forms.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,11 +177,11 @@ def clean_ignore_types(self) -> set:
177177
value = self.cleaned_data["ignore_types"]
178178
if not value:
179179
return value
180-
result = []
180+
result = set()
181181
for import_path in value:
182182
try:
183183
path, entry = import_path.rsplit(".", 1)
184-
result.append(getattr(importlib.import_module(path), entry))
184+
result.add(getattr(importlib.import_module(path), entry))
185185
except (ImportError, ValueError, AttributeError):
186186
raise forms.ValidationError(
187187
f"ignore_types contains entry that can't be imported: '{import_path}'."

src/extra_checks/registry.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,8 @@ def bind(self) -> Dict[str, Callable]:
151151
return tag_handlers
152152

153153
@property
154-
def is_healthy(self):
155-
return not self._config.errors
154+
def is_healthy(self) -> bool:
155+
return True if self._config is None else not self._config.errors
156156

157157
def ignore_checks(self, *args: Union[CheckId, str]) -> Callable[[Any], Any]:
158158
def f(entity: Any) -> Any:

0 commit comments

Comments
 (0)