Skip to content

Commit 91472d7

Browse files
committed
refactor: lint project with ruff
1 parent b5e2da6 commit 91472d7

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

certleak/core/analyzerhandler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def _start_analyzing(self):
7171

7272
def _process_update(self, update):
7373
if update is None:
74-
logging.warning("Update is None, skipping!")
74+
self.logger.warning("Update is None, skipping!")
7575

7676
self.logger.debug("Analyzing update: %s", update.all_domains)
7777
for analyzer in self.analyzers:
@@ -98,4 +98,4 @@ def stop(self):
9898

9999
join_threads(self.__threads)
100100
self.__threads = []
101-
self.logger.info("AnalyzerHandler stopped!")
101+
self.logger.info("AnalyzerHandler stopped!")

certleak/core/certstreamwrapper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def _handle_message(self, message, context):
3636
try:
3737
self._fill_queue(message, context)
3838
except Exception:
39-
logging.exception("Exception while handling certstream message!")
39+
self.logger.exception("Exception while handling certstream message!")
4040

4141
def _fill_queue(self, message, context):
4242
"""This method is being used as a callback function for the certstream module. It get's called on each new message.

certleak/util/templatingengine.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ def fill_template(update, analyzer_name, template_string, matches=None, **kwargs
2121
:param matches: A list of matches that was returned from the analyzer
2222
:return: Filled template.
2323
"""
24+
logger = logging.getLogger(__name__)
2425
if update is None:
25-
logging.error("Update is None!")
26+
logger.error("Update is None!")
2627
return None
2728

2829
update_dict = update.to_dict()
@@ -31,7 +32,7 @@ def fill_template(update, analyzer_name, template_string, matches=None, **kwargs
3132
if matches is None:
3233
update_dict["matches"] = ""
3334
elif not isinstance(matches, list):
34-
logging.error("Matches object passed to fill_template is not of type 'list'!")
35+
logger.error("Matches object passed to fill_template is not of type 'list'!")
3536
else:
3637
# When there are elements in the matches object, we want them to be formatted as single string
3738
matches_str = "\n".join(matches)

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ select = ["ALL"]
8282
ignore = [
8383
"ANN", # Annotations
8484
"ARG002", # unused-method-argument
85+
"ARG004", # Unused static method argument
8586
"BLE001", # Do not catch blind exception: `Exception`
8687
"E501", # Line too long
8788
"UP012",

0 commit comments

Comments
 (0)