forked from Github/frigate
Add isort and ruff linter (#6575)
* Add isort and ruff linter Both linters are pretty common among modern python code bases. The isort tool provides stable sorting and grouping, as well as pruning of unused imports. Ruff is a modern linter, that is very fast due to being written in rust. It can detect many common issues in a python codebase. Removes the pylint dev requirement, since ruff replaces it. * treewide: fix issues detected by ruff * treewide: fix bare except clauses * .devcontainer: Set up isort * treewide: optimize imports * treewide: apply black * treewide: make regex patterns raw strings This is necessary for escape sequences to be properly recognized.
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
"""Handle storage retention and usage."""
|
||||
|
||||
import logging
|
||||
from pathlib import Path
|
||||
import shutil
|
||||
import threading
|
||||
from pathlib import Path
|
||||
|
||||
from peewee import fn
|
||||
|
||||
@@ -107,7 +107,7 @@ class StorageMaintainer(threading.Thread):
|
||||
retained_events: Event = (
|
||||
Event.select()
|
||||
.where(
|
||||
Event.retain_indefinitely == True,
|
||||
Event.retain_indefinitely is True,
|
||||
Event.has_clip,
|
||||
)
|
||||
.order_by(Event.start_time.asc())
|
||||
@@ -188,4 +188,4 @@ class StorageMaintainer(threading.Thread):
|
||||
if self.check_storage_needs_cleanup():
|
||||
self.reduce_storage_consumption()
|
||||
|
||||
logger.info(f"Exiting storage maintainer...")
|
||||
logger.info("Exiting storage maintainer...")
|
||||
|
||||
Reference in New Issue
Block a user