Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ruff: Fix D403 #11498

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dojo/importers/base_importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def parse_dynamic_test_type_findings_from_tests(
tests: list[Test],
) -> list[Finding]:
"""
currently we only support import one Test
Currently we only support import one Test
so for parser that support multiple tests (like SARIF)
we aggregate all the findings into one uniq test
"""
Expand Down
4 changes: 2 additions & 2 deletions dojo/jira_link/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def webhook_responser_handler(
@require_POST
def webhook(request, secret=None):
"""
for examples of incoming json, see the unit tests for the webhook:
For examples of incoming json, see the unit tests for the webhook:
https://github.com/DefectDojo/django-DefectDojo/blob/master/unittests/test_jira_webhook.py
or the officials docs (which are not always clear):
https://developer.atlassian.com/server/jira/platform/webhooks/
Expand Down Expand Up @@ -168,7 +168,7 @@ def webhook(request, secret=None):

def check_for_and_create_comment(parsed_json):
"""
example incoming requests from JIRA Server 8.14.0
Example incoming requests from JIRA Server 8.14.0
{
"timestamp":1610269967824,
"webhookEvent":"comment_created",
Expand Down
4 changes: 2 additions & 2 deletions dojo/tools/scantist/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ def get_findings(self, file, test):

def get_items(self, tree, test):
"""
tree list: input tree list of all the vulnerability findings
Tree list: input tree list of all the vulnerability findings
test:
: purpose: parses input rawto extract dojo
"""

def get_findings(vuln, test):
"""
vuln : input vulnerable node
Vuln : input vulnerable node
test :
"""
vulnerability_id = vuln.get("Public ID")
Expand Down
2 changes: 1 addition & 1 deletion dojo/tools/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

def get_npm_cwe(item_node):
"""
possible values:
Possible values:
"cwe": null
"cwe": ["CWE-173", "CWE-200","CWE-601"] (or [])
"cwe": "CWE-1234"
Expand Down
2 changes: 1 addition & 1 deletion dojo/tools/wiz/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def _construct_string_field(self, fields: dict[str, str], row: dict) -> str:

def _parse_tags(self, tags: str) -> list[str]:
"""
parse the Tag string dict, and convert to a list of strings.
Parse the Tag string dict, and convert to a list of strings.

The format of the tags is is "{""key"":""value""}" format
"""
Expand Down
10 changes: 5 additions & 5 deletions unittests/test_finding_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ def run(self, result=None):

def test_sla_expiration_date(self):
"""
tests if the SLA expiration date and SLA days remaining are calculated correctly
Tests if the SLA expiration date and SLA days remaining are calculated correctly
after a finding's severity is updated
"""
user, _ = User.objects.get_or_create(username="admin")
Expand All @@ -357,7 +357,7 @@ def test_sla_expiration_date(self):

def test_sla_expiration_date_after_finding_severity_updated(self):
"""
tests if the SLA expiration date and SLA days remaining are calculated correctly
Tests if the SLA expiration date and SLA days remaining are calculated correctly
after a finding's severity is updated
"""
user, _ = User.objects.get_or_create(username="admin")
Expand Down Expand Up @@ -389,7 +389,7 @@ def test_sla_expiration_date_after_finding_severity_updated(self):

def test_sla_expiration_date_after_product_updated(self):
"""
tests if the SLA expiration date and SLA days remaining are calculated correctly
Tests if the SLA expiration date and SLA days remaining are calculated correctly
after a product changed from one SLA configuration to another
"""
user, _ = User.objects.get_or_create(username="admin")
Expand Down Expand Up @@ -428,7 +428,7 @@ def test_sla_expiration_date_after_product_updated(self):

def test_sla_expiration_date_after_sla_configuration_updated(self):
"""
tests if the SLA expiration date and SLA days remaining are calculated correctly
Tests if the SLA expiration date and SLA days remaining are calculated correctly
after the SLA configuration on a product was updated to a different number of SLA days
"""
user, _ = User.objects.get_or_create(username="admin")
Expand Down Expand Up @@ -461,7 +461,7 @@ def test_sla_expiration_date_after_sla_configuration_updated(self):

def test_sla_expiration_date_after_sla_not_enforced(self):
"""
tests if the SLA expiration date is none after the after the SLA configuration on a
Tests if the SLA expiration date is none after the after the SLA configuration on a
product was updated to not enforce all SLA remediation days
"""
user, _ = User.objects.get_or_create(username="admin")
Expand Down
2 changes: 1 addition & 1 deletion unittests/tools/test_sonarqube_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ def test_detailed_parse_file_with_vuln_issue_3725(self):

def test_detailed_parse_file_table_has_whitespace(self):
"""
from version 3.1.1: sonarqube-report has new template with some change.
From version 3.1.1: sonarqube-report has new template with some change.
see: https://github.com/soprasteria/sonar-report/commit/7dab559e7ecf9ed319345e9262a8b160bd3af94f
Data table will have some whitespaces, parser should strip it before compare or use these properties.
"""
Expand Down
Loading