Skip to content

Commit c593fe3

Browse files
Ruff: Add N813 (#12073)
Co-authored-by: Cody Maffucci <46459665+Maffooch@users.noreply.github.com>
1 parent 7d4009c commit c593fe3

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

dojo/reports/widgets.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from collections import OrderedDict
44

55
from django import forms
6-
from django.forms import Widget as form_widget
6+
from django.forms import Widget
77
from django.forms.utils import flatatt
88
from django.http import QueryDict
99
from django.template.loader import render_to_string
@@ -56,7 +56,7 @@ class Meta:
5656
exclude = []
5757

5858

59-
class Div(form_widget):
59+
class Div(Widget):
6060
def __init__(self, attrs=None):
6161
# Use slightly better defaults than HTML's 20x2 box
6262
default_attrs = {"style": "width:100%;min-height:400px"}

dojo/tools/burp/parser.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import re
44

55
import html2text
6-
from defusedxml import ElementTree as etree
6+
from defusedxml import ElementTree
77

88
from dojo.models import Endpoint, Finding
99

@@ -80,7 +80,7 @@ def get_description_for_scan_types(self, scan_type):
8080
)
8181

8282
def get_findings(self, xml_output, test):
83-
tree = etree.parse(xml_output, etree.XMLParser())
83+
tree = ElementTree.parse(xml_output, ElementTree.XMLParser())
8484
return self.get_items(tree, test)
8585

8686
def get_items(self, tree, test):

dojo/tools/burp_dastardly/parser.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import logging
22

3-
from defusedxml import ElementTree as etree
3+
from defusedxml import ElementTree
44

55
from dojo.models import Finding
66

@@ -21,7 +21,7 @@ def get_description_for_scan_types(self, scan_type):
2121
)
2222

2323
def get_findings(self, xml_output, test):
24-
tree = etree.parse(xml_output, etree.XMLParser())
24+
tree = ElementTree.parse(xml_output, ElementTree.XMLParser())
2525
return self.get_items(tree, test)
2626

2727
def get_items(self, tree, test):

dojo/tools/qualys/parser.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
import html2text
55
from cvss import CVSS3
6-
from defusedxml import ElementTree as etree
6+
from defusedxml import ElementTree
77
from django.conf import settings
88

99
from dojo.models import Endpoint, Finding
@@ -345,8 +345,8 @@ def parse_finding(host, tree):
345345

346346

347347
def qualys_parser(qualys_xml_file):
348-
parser = etree.XMLParser()
349-
tree = etree.parse(qualys_xml_file, parser)
348+
parser = ElementTree.XMLParser()
349+
tree = ElementTree.parse(qualys_xml_file, parser)
350350
host_list = tree.find("HOST_LIST")
351351
finding_list = []
352352
if host_list is not None:

ruff.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ select = [
3737
"W",
3838
"C90",
3939
"I",
40-
"N803", "N804", "N811", "N812", "N814", "N817", "N818",
40+
"N803", "N804", "N811", "N812", "N813", "N814", "N817", "N818",
4141
"D2", "D3", "D402", "D403", "D405", "D406", "D407", "D408", "D409", "D410", "D411", "D412", "D413", "D414", "D416",
4242
"UP",
4343
"YTT",

0 commit comments

Comments
 (0)