Skip to content

Commit

Permalink
Update pytest snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Feb 9, 2024
1 parent 9edb51e commit de68b8a
Show file tree
Hide file tree
Showing 22 changed files with 52 additions and 60 deletions.
5 changes: 2 additions & 3 deletions tests/acceptance/baseline-generic/new-agent.out
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
└─────────────────────────┘

bar.py
python.lang.correctness.useless-eqeq.useless-eqeq
This expression is always True: `2 == 2` or `2 != 2`. If testing for
floating point NaN, use
❱ python.lang.correctness.useless-eqeq.useless-eqeq
This expression is always True: `2 == 2` or `2 != 2`. If testing for floating point NaN, use
`math.isnan(2)`, or `cmath.isnan(2)` if the number is complex.
Details: https://sg.run/GeAp

Expand Down
5 changes: 2 additions & 3 deletions tests/acceptance/baseline-local-file/new-agent.out
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
└─────────────────────────┘

bar.py
python.lang.correctness.useless-eqeq.useless-eqeq
This expression is always True: `3 == 3` or `3 != 3`. If testing for
floating point NaN, use
❱ python.lang.correctness.useless-eqeq.useless-eqeq
This expression is always True: `3 == 3` or `3 != 3`. If testing for floating point NaN, use
`math.isnan(3)`, or `cmath.isnan(3)` if the number is complex.
Details: https://sg.run/GeAp

Expand Down
7 changes: 3 additions & 4 deletions tests/acceptance/disconnected-generic/disconnected-agent.out
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
└─────────────────────────┘

foo.py
python.lang.correctness.useless-eqeq.useless-eqeq
This expression is always True: `10 == 10` or `10 != 10`. If testing
for floating point NaN,
use `math.isnan(10)`, or `cmath.isnan(10)` if the number is complex.
❱ python.lang.correctness.useless-eqeq.useless-eqeq
This expression is always True: `10 == 10` or `10 != 10`. If testing for floating point NaN, use
`math.isnan(10)`, or `cmath.isnan(10)` if the number is complex.
Details: https://sg.run/GeAp

1┆ 10 == 10
Expand Down
4 changes: 2 additions & 2 deletions tests/acceptance/ignore-logs/new-agent.err
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
┌─────────────┐
│ Scan Status │
└─────────────┘
Scanning 2 files tracked by git with 98 Code rules:
Scanning 2 files tracked by git with 122 Code rules:
Scanning 1 file.
Current version has 0 findings.

Expand All @@ -31,5 +31,5 @@ Some files were skipped or only partially analyzed.
(need more rules? `semgrep login` for additional free Semgrep Registry rules)

CI scan completed successfully.
Found 0 findings (0 blocking) from 98 rules.
Found 0 findings (0 blocking) from 122 rules.
No blocking findings so exiting with code 0
14 changes: 6 additions & 8 deletions tests/acceptance/mergebase-generic/new-agent.out
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,17 @@
└──────────────────────────┘

baz.py
python.lang.correctness.useless-eqeq.useless-eqeq
This expression is always True: `15 == 15` or `15 != 15`. If testing
for floating point NaN,
use `math.isnan(15)`, or `cmath.isnan(15)` if the number is complex.
❱ python.lang.correctness.useless-eqeq.useless-eqeq
This expression is always True: `15 == 15` or `15 != 15`. If testing for floating point NaN, use
`math.isnan(15)`, or `cmath.isnan(15)` if the number is complex.
Details: https://sg.run/GeAp

1┆ 15 == 15

foo.py
python.lang.correctness.useless-eqeq.useless-eqeq
This expression is always True: `10 == 10` or `10 != 10`. If testing
for floating point NaN,
use `math.isnan(10)`, or `cmath.isnan(10)` if the number is complex.
❱ python.lang.correctness.useless-eqeq.useless-eqeq
This expression is always True: `10 == 10` or `10 != 10`. If testing for floating point NaN, use
`math.isnan(10)`, or `cmath.isnan(10)` if the number is complex.
Details: https://sg.run/GeAp

1┆ 10 == 10
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
run `semgrep login` before using `semgrep ci` or set `--config`
run `semgrep login` before using `semgrep ci` or use `semgrep scan` and set `--config`
Original file line number Diff line number Diff line change
@@ -1 +1 @@
run `semgrep login` before using `semgrep ci` or set `--config`
run `semgrep login` before using `semgrep ci` or use `semgrep scan` and set `--config`
2 changes: 1 addition & 1 deletion tests/acceptance/misconfigured-generic/missing-config.err
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
=== Running: semgrep ci --no-suppress-errors
run `semgrep login` before using `semgrep ci` or set `--config`
run `semgrep login` before using `semgrep ci` or use `semgrep scan` and set `--config`
6 changes: 3 additions & 3 deletions tests/acceptance/multiconfig-generic/new-agent.err
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
┌─────────────┐
│ Scan Status │
└─────────────┘
Scanning 1 file tracked by git with 98 Code rules:
Scanning 1 file tracked by git with 123 Code rules:

Language Rules Files Origin Rules
───────────────────────────── ───────────────────
python 7 1 Community 98
python 9 1 Community 123
<multilang> 1 1

Current version has 1 finding.
Expand All @@ -32,5 +32,5 @@ Some files were skipped or only partially analyzed.
Scan was limited to files changed since baseline commit.

CI scan completed successfully.
Found 1 finding (1 blocking) from 98 rules.
Found 1 finding (1 blocking) from 123 rules.
Has findings for blocking rules so exiting with code 1
5 changes: 2 additions & 3 deletions tests/acceptance/multiconfig-generic/new-agent.out
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
└─────────────────────────┘

bar.py
python.lang.correctness.useless-eqeq.useless-eqeq
This expression is always True: `2 == 2` or `2 != 2`. If testing for
floating point NaN, use
❱ python.lang.correctness.useless-eqeq.useless-eqeq
This expression is always True: `2 == 2` or `2 != 2`. If testing for floating point NaN, use
`math.isnan(2)`, or `cmath.isnan(2)` if the number is complex.
Details: https://sg.run/GeAp

Expand Down
6 changes: 3 additions & 3 deletions tests/acceptance/mutlimerge-generic/new-agent.err
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
┌─────────────┐
│ Scan Status │
└─────────────┘
Scanning 1 file tracked by git with 98 Code rules:
Scanning 1 file tracked by git with 122 Code rules:

Language Rules Files Origin Rules
───────────────────────────── ───────────────────
python 7 1 Community 98
python 9 1 Community 122
<multilang> 1 1

Current version has 0 findings.
Expand All @@ -34,5 +34,5 @@ Some files were skipped or only partially analyzed.
(need more rules? `semgrep login` for additional free Semgrep Registry rules)

CI scan completed successfully.
Found 0 findings (0 blocking) from 98 rules.
Found 0 findings (0 blocking) from 122 rules.
No blocking findings so exiting with code 0
7 changes: 3 additions & 4 deletions tests/acceptance/push-generic/push-agent.out
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
└─────────────────────────┘

foo.py
python.lang.correctness.useless-eqeq.useless-eqeq
This expression is always True: `10 == 10` or `10 != 10`. If testing
for floating point NaN,
use `math.isnan(10)`, or `cmath.isnan(10)` if the number is complex.
❱ python.lang.correctness.useless-eqeq.useless-eqeq
This expression is always True: `10 == 10` or `10 != 10`. If testing for floating point NaN, use
`math.isnan(10)`, or `cmath.isnan(10)` if the number is complex.
Details: https://sg.run/GeAp

1┆ 10 == 10
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
└──────────────────────────┘

python/lang/best-practice/sleep.py
python.lang.best-practice.arbitrary-sleep
❯❯❱ python.lang.best-practice.arbitrary-sleep
time.sleep() call; did you mean to leave this in?

12┆ t.sleep(5)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@
└──────────────────────────┘

python/django/security/audit/xss/template-translate-as-no-escape.html
python.django.security.audit.xss.template-translate-as-no-escape
Translated strings will not be escaped when rendered in a template.
This leads to a
vulnerability where translators could include malicious script tags in
their translations.
Consider using `force_escape` to explicitly escape a transalted text.
❱ python.django.security.audit.xss.template-translate-as-no-escape
Translated strings will not be escaped when rendered in a template. This leads to a vulnerability
where translators could include malicious script tags in their translations. Consider using
`force_escape` to explicitly escape a transalted text.

2┆ {% translate "Hello world" as the_title %}
3┆ <div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@

SCAN ENVIRONMENT
versions - semgrep x.y.z on python x.y.z
environment - running in environment github-actions, triggering event is
unknown
environment - running in environment github-actions, triggering event is unknown


┌─────────────┐
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"errors": [], "paths": {"_comment": "<add --verbose for a list of skipped paths>", "scanned": ["python/django/security/audit/xss/template-blocktranslate-no-escape.html", "python/django/security/audit/xss/template-blocktranslate-no-escape.yaml", "python/django/security/audit/xss/template-translate-as-no-escape.html", "python/django/security/audit/xss/template-translate-as-no-escape.yaml", "python/django/security/audit/xss/template-translate-no-escape.html", "python/django/security/audit/xss/template-translate-no-escape.yaml"]}, "results": [{"check_id": "python.django.security.audit.xss.template-translate-as-no-escape", "end": {"col": 20, "line": 4, "offset": 117}, "extra": {"engine_kind": "OSS", "fingerprint": "d8dc2478e002dedfd9c2d410f6b9a8ff46d070d80c65728e2cf6b8a7c016b16614976de312d01ada1bee21eb89448ac73a6110a1c1ecbe35d7df9840eb4a9870_0", "is_ignored": false, "lines": "{% translate \"Hello world\" as the_title %}\n<div>\n<h1>{{ the_title }}</h1>", "message": "Translated strings will not be escaped when rendered in a template.\nThis leads to a vulnerability where translators could include malicious script tags in their translations.\nConsider using `force_escape` to explicitly escape a transalted text.\n", "metadata": {"cwe": "CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')", "owasp": "A7: Cross-site Scripting (XSS)", "references": ["https://edx.readthedocs.io/projects/edx-developer-guide/en/latest/preventing_xss/preventing_xss_in_django_templates.html#html-escaping-translations-in-django-templates", "https://docs.djangoproject.com/en/3.1/topics/i18n/translation/#internationalization-in-template-code"]}, "metavars": {"$TRANS": {"abstract_content": "the_title", "end": {"col": 40, "line": 2, "offset": 88}, "start": {"col": 31, "line": 2, "offset": 79}}}, "severity": "INFO"}, "path": "python/django/security/audit/xss/template-translate-as-no-escape.html", "start": {"col": 1, "line": 2, "offset": 49}}, {"check_id": "python.django.security.audit.xss.template-translate-as-no-escape", "end": {"col": 15, "line": 9, "offset": 229}, "extra": {"engine_kind": "OSS", "fingerprint": "fa6a9f618686d3d1fadc6b2043dfffa90cf409c3e3b523b60bdb67da5960774bb917d9894d29c71ac38fad0ad46f2294d9618af7673bddc8006b4e94c8787830_0", "is_ignored": false, "lines": "{% trans \"Hello world\" as title %}\n<p>{{ title }}</p>", "message": "Translated strings will not be escaped when rendered in a template.\nThis leads to a vulnerability where translators could include malicious script tags in their translations.\nConsider using `force_escape` to explicitly escape a transalted text.\n", "metadata": {"cwe": "CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')", "owasp": "A7: Cross-site Scripting (XSS)", "references": ["https://edx.readthedocs.io/projects/edx-developer-guide/en/latest/preventing_xss/preventing_xss_in_django_templates.html#html-escaping-translations-in-django-templates", "https://docs.djangoproject.com/en/3.1/topics/i18n/translation/#internationalization-in-template-code"]}, "metavars": {"$TRANS": {"abstract_content": "title", "end": {"col": 32, "line": 8, "offset": 211}, "start": {"col": 27, "line": 8, "offset": 206}}}, "severity": "INFO"}, "path": "python/django/security/audit/xss/template-translate-as-no-escape.html", "start": {"col": 1, "line": 8, "offset": 180}}], "version": "x.y.z"}
{"errors": [], "interfile_languages_used": [], "paths": {"scanned": ["python/django/security/audit/xss/template-blocktranslate-no-escape.html", "python/django/security/audit/xss/template-blocktranslate-no-escape.yaml", "python/django/security/audit/xss/template-translate-as-no-escape.html", "python/django/security/audit/xss/template-translate-as-no-escape.yaml", "python/django/security/audit/xss/template-translate-no-escape.html", "python/django/security/audit/xss/template-translate-no-escape.yaml"]}, "results": [{"check_id": "python.django.security.audit.xss.template-translate-as-no-escape", "end": {"col": 20, "line": 4, "offset": 117}, "extra": {"engine_kind": "OSS", "fingerprint": "d8dc2478e002dedfd9c2d410f6b9a8ff46d070d80c65728e2cf6b8a7c016b16614976de312d01ada1bee21eb89448ac73a6110a1c1ecbe35d7df9840eb4a9870_0", "is_ignored": false, "lines": "{% translate \"Hello world\" as the_title %}\n<div>\n<h1>{{ the_title }}</h1>", "message": "Translated strings will not be escaped when rendered in a template.\nThis leads to a vulnerability where translators could include malicious script tags in their translations.\nConsider using `force_escape` to explicitly escape a transalted text.\n", "metadata": {"cwe": "CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')", "owasp": "A7: Cross-site Scripting (XSS)", "references": ["https://edx.readthedocs.io/projects/edx-developer-guide/en/latest/preventing_xss/preventing_xss_in_django_templates.html#html-escaping-translations-in-django-templates", "https://docs.djangoproject.com/en/3.1/topics/i18n/translation/#internationalization-in-template-code"]}, "metavars": {"$TRANS": {"abstract_content": "the_title", "end": {"col": 40, "line": 2, "offset": 88}, "start": {"col": 31, "line": 2, "offset": 79}}}, "severity": "INFO", "validation_state": "NO_VALIDATOR"}, "path": "python/django/security/audit/xss/template-translate-as-no-escape.html", "start": {"col": 1, "line": 2, "offset": 49}}, {"check_id": "python.django.security.audit.xss.template-translate-as-no-escape", "end": {"col": 15, "line": 9, "offset": 229}, "extra": {"engine_kind": "OSS", "fingerprint": "fa6a9f618686d3d1fadc6b2043dfffa90cf409c3e3b523b60bdb67da5960774bb917d9894d29c71ac38fad0ad46f2294d9618af7673bddc8006b4e94c8787830_0", "is_ignored": false, "lines": "{% trans \"Hello world\" as title %}\n<p>{{ title }}</p>", "message": "Translated strings will not be escaped when rendered in a template.\nThis leads to a vulnerability where translators could include malicious script tags in their translations.\nConsider using `force_escape` to explicitly escape a transalted text.\n", "metadata": {"cwe": "CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')", "owasp": "A7: Cross-site Scripting (XSS)", "references": ["https://edx.readthedocs.io/projects/edx-developer-guide/en/latest/preventing_xss/preventing_xss_in_django_templates.html#html-escaping-translations-in-django-templates", "https://docs.djangoproject.com/en/3.1/topics/i18n/translation/#internationalization-in-template-code"]}, "metavars": {"$TRANS": {"abstract_content": "title", "end": {"col": 32, "line": 8, "offset": 211}, "start": {"col": 27, "line": 8, "offset": 206}}}, "severity": "INFO", "validation_state": "NO_VALIDATOR"}, "path": "python/django/security/audit/xss/template-translate-as-no-escape.html", "start": {"col": 1, "line": 8, "offset": 180}}], "skipped_rules": [], "version": "x.y.z"}
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,15 @@
{
"category": "sast",
"cve": "python/django/security/audit/xss/template-translate-as-no-escape.html:676a433f628cec7914931f26ad682a3c0e54381b0ae0f5795c47f740e439889a:python.django.security.audit.xss.template-translate-as-no-escape",
"description": "Translated strings will not be escaped when rendered in a template.\nThis leads to a vulnerability where translators could include malicious script tags in their translations.\nConsider using `force_escape` to explicitly escape a transalted text.\n",
"details": {},
"flags": [],
"id": "d09ee83a-faa4-91ef-daa4-3032a2a896e1",
"identifiers": [
{
"name": "Semgrep - python.django.security.audit.xss.template-translate-as-no-escape",
"type": "semgrep_type",
"url": "https://semgrep.dev/r/python.django.security.audit.xss.template-translate-as-no-escape",
"url": null,
"value": "python.django.security.audit.xss.template-translate-as-no-escape"
}
],
Expand All @@ -59,14 +60,15 @@
{
"category": "sast",
"cve": "python/django/security/audit/xss/template-translate-as-no-escape.html:676a433f628cec7914931f26ad682a3c0e54381b0ae0f5795c47f740e439889a:python.django.security.audit.xss.template-translate-as-no-escape",
"description": "Translated strings will not be escaped when rendered in a template.\nThis leads to a vulnerability where translators could include malicious script tags in their translations.\nConsider using `force_escape` to explicitly escape a transalted text.\n",
"details": {},
"flags": [],
"id": "c05aaeaf-7b55-6fde-76e5-13617669ae1e",
"identifiers": [
{
"name": "Semgrep - python.django.security.audit.xss.template-translate-as-no-escape",
"type": "semgrep_type",
"url": "https://semgrep.dev/r/python.django.security.audit.xss.template-translate-as-no-escape",
"url": null,
"value": "python.django.security.audit.xss.template-translate-as-no-escape"
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,15 @@
{
"category": "sast",
"cve": "python/django/security/audit/xss/template-translate-as-no-escape.html:676a433f628cec7914931f26ad682a3c0e54381b0ae0f5795c47f740e439889a:python.django.security.audit.xss.template-translate-as-no-escape",
"description": "Translated strings will not be escaped when rendered in a template.\nThis leads to a vulnerability where translators could include malicious script tags in their translations.\nConsider using `force_escape` to explicitly escape a transalted text.\n",
"details": {},
"flags": [],
"id": "d09ee83a-faa4-91ef-daa4-3032a2a896e1",
"identifiers": [
{
"name": "Semgrep - python.django.security.audit.xss.template-translate-as-no-escape",
"type": "semgrep_type",
"url": "https://semgrep.dev/r/python.django.security.audit.xss.template-translate-as-no-escape",
"url": null,
"value": "python.django.security.audit.xss.template-translate-as-no-escape"
}
],
Expand All @@ -59,14 +60,15 @@
{
"category": "sast",
"cve": "python/django/security/audit/xss/template-translate-as-no-escape.html:676a433f628cec7914931f26ad682a3c0e54381b0ae0f5795c47f740e439889a:python.django.security.audit.xss.template-translate-as-no-escape",
"description": "Translated strings will not be escaped when rendered in a template.\nThis leads to a vulnerability where translators could include malicious script tags in their translations.\nConsider using `force_escape` to explicitly escape a transalted text.\n",
"details": {},
"flags": [],
"id": "c05aaeaf-7b55-6fde-76e5-13617669ae1e",
"identifiers": [
{
"name": "Semgrep - python.django.security.audit.xss.template-translate-as-no-escape",
"type": "semgrep_type",
"url": "https://semgrep.dev/r/python.django.security.audit.xss.template-translate-as-no-escape",
"url": null,
"value": "python.django.security.audit.xss.template-translate-as-no-escape"
}
],
Expand Down
Loading

0 comments on commit de68b8a

Please sign in to comment.