-
-
Notifications
You must be signed in to change notification settings - Fork 323
Add mypy type checking to CI (#226) #2398
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
base: main
Are you sure you want to change the base?
Changes from all commits
b9ddbbd
32166d6
7c15938
78e9e29
9f41d51
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| [mypy] | ||
| ignore_missing_imports = True | ||
| follow_imports = silent | ||
| explicit_package_bases = True | ||
| namespace_packages = True | ||
|
|
||
| check_untyped_defs = True | ||
|
|
||
| warn_unused_configs = True | ||
| warn_redundant_casts = True | ||
| warn_unused_ignores = True | ||
|
|
||
| strict_equality = True | ||
| warn_return_any = True | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are a lot of options available. The main question is whether any of them work well with django without requiring a plugin. |
||
|
|
||
| files = | ||
| # fetch and parse vulnerability data from upstream sources | ||
| vulnerabilities/importers/debian_oval.py, | ||
| vulnerabilities/importers/epss.py, | ||
| vulnerabilities/importers/project_kb_msr2019.py, | ||
| vulnerabilities/importers/redhat.py, | ||
| vulnerabilities/importers/suse_scores.py, | ||
| vulnerabilities/importers/ubuntu_usn.py, | ||
| vulnerabilities/importers/xen.py, | ||
|
Comment on lines
+16
to
+24
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should use an exclude list instead. Adding every file individually isn't a good option, especially because whenever we create a new file, it will require manually updating the mypy configuration. |
||
|
|
||
| # shared logic that transforms advisory data after import | ||
| vulnerabilities/pipes/apache_kafka.py, | ||
| vulnerabilities/pipes/export.py, | ||
| vulnerabilities/pipes/extractcode_utils.py, | ||
| vulnerabilities/pipes/federatedcode.py, | ||
|
|
||
| # CLI entry points for imports, improvers, and scheduling | ||
| vulnerabilities/management/commands/create_api_user.py, | ||
| vulnerabilities/management/commands/import.py, | ||
| vulnerabilities/management/commands/improve.py, | ||
| vulnerabilities/management/commands/run_scheduler.py, | ||
|
|
||
| # how vulnerabilities are scored, related, and scheduled | ||
| vulnerabilities/risk.py, | ||
| vulnerabilities/references.py, | ||
| vulnerabilities/schedules.py, | ||
| vulnerabilities/pipelines/v2_importers/collect_fix_commits.py, | ||
|
|
||
| # API pagination and rate limiting | ||
| vulnerabilities/pagination.py, | ||
| vulnerabilities/throttling.py, | ||
|
|
||
| # supporting utilities | ||
| vulnerabilities/rpm_utils.py, | ||
| vulnerabilities/weight_config.py, | ||
|
|
||
| # fully clean directories: request middleware and template tags | ||
| vulnerabilities/middleware, | ||
| vulnerabilities/templatetags, | ||
|
|
||
| # Django project configuration | ||
| vulnerablecode/__init__.py, | ||
| vulnerablecode/context_processors.py, | ||
| vulnerablecode/urls.py, | ||
| vulnerablecode/wsgi.py, | ||
|
|
||
| # shared library for deterministic advisory IDs | ||
| aboutcode, | ||
|
|
||
| # bundled CLI tool for cross-checking vulnerability sources | ||
| vulntotal/__init__.py, | ||
| vulntotal/vulntotal_utils.py, | ||
| vulntotal/ecosystem, | ||
| vulntotal/datasources/safetydb.py, | ||
| vulntotal/tests, | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think
mypycommand should also be part ofcheckcommand