-
Notifications
You must be signed in to change notification settings - Fork 685
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
Add mypy to CI #9430
Add mypy to CI #9430
Conversation
Skipping CI for Draft Pull Request. |
8cc88f8
to
3b4008b
Compare
/packit build |
aa9d5e1
to
1d906c4
Compare
/packit build |
389997a
to
0dfb9ab
Compare
Code Climate has analyzed commit b96f3c0 and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 100.0% (50% is the threshold). This pull request will bring the total coverage in the repository to 40.7% (0.0% change). View more on Code Climate. |
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.
It's super useful I like the idea.
When I break something in the tested sources then it works:
[jcerny@thinkpad build{pr/9430}]$ ctest --verbose -R test-mypy
UpdateCTestConfiguration from :/home/jcerny/work/git/scap-security-guide/build/DartConfiguration.tcl
UpdateCTestConfiguration from :/home/jcerny/work/git/scap-security-guide/build/DartConfiguration.tcl
Test project /home/jcerny/work/git/scap-security-guide/build
Constructing a list of tests
Done constructing a list of tests
Updating test list for fixtures
Added 0 tests to meet fixture requirements
Checking test dependency graph...
Checking test dependency graph end
test 26
Start 26: test-mypy
26: Test command: /usr/bin/env "/usr/bin/python3" "-m" "mypy" "/home/jcerny/work/git/scap-security-guide/utils/import_srg_spreadsheet.py"
26: Test timeout computed to be: 10000000
26: /home/jcerny/work/git/scap-security-guide/utils/import_srg_spreadsheet.py:45: error: Incompatible types in assignment (expression has type "str", variable has type "int")
26: /home/jcerny/work/git/scap-security-guide/utils/import_srg_spreadsheet.py:107: error: Argument 2 to "from_row" of "Row" has incompatible type "int"; expected "str"
26: Found 2 errors in 1 file (checked 1 source file)
1/1 Test #26: test-mypy ........................***Failed 3.73 sec
0% tests passed, 1 tests failed out of 1
Total Test time (real) = 3.73 sec
The following tests FAILED:
26 - test-mypy (Failed)
Errors while running CTest
Output from these tests are in: /home/jcerny/work/git/scap-security-guide/build/Testing/Temporary/LastTest.log
Use "--rerun-failed --output-on-failure" to re-run the failed cases verbosely.
|
||
```bash | ||
# Fedora/RHEL | ||
yum install python3-mypy |
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.
dnf
Description:
Add MyPy to the project's CI. MyPy is a static type checker for Python.
This will help enforce our type hits. Currently, this will be opt-in to avoid lots of errors in CI.
Rationale:
MyPy adds static type checking to help find errors sooner.