~alexmurray/ubuntu-cve-tracker:fix-pyright-warnings-in-check-cves

Last commit made on 2024-03-18
Get this branch:
git clone -b fix-pyright-warnings-in-check-cves https://git.launchpad.net/~alexmurray/ubuntu-cve-tracker
Only Alex Murray can upload to this branch. If you are Alex Murray please log in for upload directions.

Branch merges

Branch information

Name:
fix-pyright-warnings-in-check-cves
Repository:
lp:~alexmurray/ubuntu-cve-tracker

Recent commits

625794f... by Alex Murray

scripts/check-cves: fix a bunch of pyright warnings

Before:

± pyright scripts/check-cves
/home/amurray/ubuntu/git/ubuntu-cve-tracker/scripts/check-cves
  /home/amurray/ubuntu/git/ubuntu-cve-tracker/scripts/check-cves:211:32 - error: Object of type "str" is not callable (reportCallIssue)
  /home/amurray/ubuntu/git/ubuntu-cve-tracker/scripts/check-cves:252:37 - error: Operator "+" not supported for types "str | Unknown | list[str | Unknown] | list[Unknown]" and "Literal['/data/DSA/list']"
    Operator "+" not supported for types "list[str | Unknown]" and "Literal['/data/DSA/list']"
    Operator "+" not supported for types "list[Unknown]" and "Literal['/data/DSA/list']" (reportOperatorIssue)
  /home/amurray/ubuntu/git/ubuntu-cve-tracker/scripts/check-cves:326:32 - error: Argument of type "(cve: Unknown) -> Unknown" cannot be assigned to parameter "desc" of type "str" in function "convert_to_nvd"
    "function" is incompatible with "str" (reportArgumentType)
  /home/amurray/ubuntu/git/ubuntu-cve-tracker/scripts/check-cves:414:32 - error: Argument of type "(cve: Unknown) -> Unknown" cannot be assigned to parameter "desc" of type "str" in function "convert_to_nvd"
    "function" is incompatible with "str" (reportArgumentType)
  /home/amurray/ubuntu/git/ubuntu-cve-tracker/scripts/check-cves:497:32 - error: Argument of type "(c: Unknown) -> str" cannot be assigned to parameter "desc" of type "str" in function "convert_to_nvd"
    "function" is incompatible with "str" (reportArgumentType)
  /home/amurray/ubuntu/git/ubuntu-cve-tracker/scripts/check-cves:597:52 - error: Operator "+" not supported for types "str | Unknown | list[str | Unknown] | list[Unknown]" and "Literal['/data/CVE/list']"
    Operator "+" not supported for types "list[str | Unknown]" and "Literal['/data/CVE/list']"
    Operator "+" not supported for types "list[Unknown]" and "Literal['/data/CVE/list']" (reportOperatorIssue)
  /home/amurray/ubuntu/git/ubuntu-cve-tracker/scripts/check-cves:780:49 - error: Operator "not in" not supported for types "Literal['Previously triaged as ignored in Ubuntu\n\n']" and "str | None"
    Operator "not in" not supported for types "Literal['Previously triaged as ignored in Ubuntu\n\n']" and "None" (reportOperatorIssue)
  /home/amurray/ubuntu/git/ubuntu-cve-tracker/scripts/check-cves:786:30 - error: "split" is not a known member of "None" (reportOptionalMemberAccess)
  /home/amurray/ubuntu/git/ubuntu-cve-tracker/scripts/check-cves:791:27 - error: "find" is not a known member of "None" (reportOptionalMemberAccess)
  /home/amurray/ubuntu/git/ubuntu-cve-tracker/scripts/check-cves:791:59 - error: "find" is not a known member of "None" (reportOptionalMemberAccess)
  /home/amurray/ubuntu/git/ubuntu-cve-tracker/scripts/check-cves:1474:20 - error: "_exceptions" is not a known member of module "xml.sax" (reportAttributeAccessIssue)
  /home/amurray/ubuntu/git/ubuntu-cve-tracker/scripts/check-cves:1622:39 - error: Argument of type "_TemporaryFileWrapper[str] | TextIO" cannot be assigned to parameter "file" of type "TextIO" in function "display_cve"
    Type "_TemporaryFileWrapper[str] | TextIO" cannot be assigned to type "TextIO"
      "_TemporaryFileWrapper[str]" is incompatible with "TextIO" (reportArgumentType)
  /home/amurray/ubuntu/git/ubuntu-cve-tracker/scripts/check-cves:1631:39 - error: Argument of type "_TemporaryFileWrapper[str] | TextIO" cannot be assigned to parameter "file" of type "TextIO" in function "display_cve"
    Type "_TemporaryFileWrapper[str] | TextIO" cannot be assigned to type "TextIO"
      "_TemporaryFileWrapper[str]" is incompatible with "TextIO" (reportArgumentType)
13 errors, 0 warnings, 0 informations

After:

± pyright scripts/check-cves
/home/amurray/ubuntu/git/ubuntu-cve-tracker/scripts/check-cves
  /home/amurray/ubuntu/git/ubuntu-cve-tracker/scripts/check-cves:253:37 - error: Operator "+" not supported for types "str | Unknown | list[str | Unknown] | list[Unknown]" and "Literal['/data/DSA/list']"
    Operator "+" not supported for types "list[str | Unknown]" and "Literal['/data/DSA/list']"
    Operator "+" not supported for types "list[Unknown]" and "Literal['/data/DSA/list']" (reportOperatorIssue)
  /home/amurray/ubuntu/git/ubuntu-cve-tracker/scripts/check-cves:598:52 - error: Operator "+" not supported for types "str | Unknown | list[str | Unknown] | list[Unknown]" and "Literal['/data/CVE/list']"
    Operator "+" not supported for types "list[str | Unknown]" and "Literal['/data/CVE/list']"
    Operator "+" not supported for types "list[Unknown]" and "Literal['/data/CVE/list']" (reportOperatorIssue)
2 errors, 0 warnings, 0 informations

Signed-off-by: Alex Murray <email address hidden>

Failed
[SUCCEEDED] unit-tests:0 (build)
[FAILED] check-cves:0 (build)
12 of 2 results
5134d56... by Marc Deslauriers

added regression commit to squid CVE

8068db9... by Steve Beattie

Process cves run: triaged 4 CVEs, 60 Ignored, 4 Packages

Packages with new cves:
  cimg(1) libspring-java(1) python-djangorestframework-simplejwt(1)
  radare2(1)

Signed-off-by: Steve Beattie <email address hidden>

a53161a... by Steve Beattie

Process cves run: triaged 6 CVEs, 72 Ignored, 6 Packages

Packages with new cves:
  designate(1) glpi(1) gpac(2) linux(1) xen(1) zookeeper(1)

Signed-off-by: Steve Beattie <email address hidden>

bc50b6e... by Steve Beattie

check-cves: write check-cves.log if early quit

Signed-off-by: Steve Beattie <email address hidden>

1817798... by Steve Beattie

Process cves run: triaged 25 CVEs, 4 Ignored, 1 Packages

Packages with new cves:
  linux(25)

Signed-off-by: Steve Beattie <email address hidden>

6f6eb4c... by Steve Beattie

check-cves: convert to use f-strings

* [f3ff0409d3a] check-cves: switch formatting regular strings to f-strings and friends
* [946c26c48f8] check-cves: fix f-string change that removed tuple

Signed-off-by: Steve Beattie <email address hidden>
MR: https://code.launchpad.net/~eslerm/ubuntu-cve-tracker/+git/ubuntu-cve-tracker/+merge/462539

946c26c... by Steve Beattie

check-cves: fix f-string change that removed tuple

The commit e57a2a0d094 (check-cves: switch formatting regular strings
to f-strings and friends, 2024-03-15) made the following change in
CVEHandler.add_cve():

- not_affected.append((pkg, "debian: %s" % self.debian[cve]['pkgs'][pkg]['priority']))
+ not_affected.append(pkg, f"debian: {self.debian[cve]['pkgs'][pkg]['priority']}")

which, while converting an f-string, dropped that a tuple was being
passed to append(), which only takes one argument, breaking the call.
Fix it by re-instating the tuple.

Signed-off-by: Steve Beattie <email address hidden>
MR: https://code.launchpad.net/~eslerm/ubuntu-cve-tracker/+git/ubuntu-cve-tracker/+merge/462539

1272f18... by Steve Beattie

Process cves run: triaged 3 CVEs, 4 Ignored, 2 Packages

Packages with new cves:
  linux(2) ruby-rotp(1)

Signed-off-by: Steve Beattie <email address hidden>

5d65867... by Steve Beattie

Process cves run: triaged 0 CVEs, 16 Ignored, 0 Packages

Signed-off-by: Steve Beattie <email address hidden>