Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pre-commit: Update all hook versions and apply fixes
Vermin 1.6.0 was recently released, which contains a fix for netromdk/vermin#230. This was a rather odd corner case, in which Vermin would fail when code was compatible with 2.x and 3.x, yet the command line only required compatibility with 3.x. Since pre-commit runs against only files that changed, this was possible, for example with small test files. I'm not sure if I encountered it in drgn (I know I did with drgn-tools), but it's good to have the fix. I used pre-commit autoupdate, so we have the latest version of each hook now. In particular, this commit surpasses mypy 0.971, which is the last version to support Python 3.6 at runtime. Mypy still supports targeting Python 3.6[1]. [1]: https://mypy-lang.blogspot.com/2022/07/mypy-0971-released.html Two new errors were surfaced with the new hooks: 1. Mypy complained about the pattern "os.exit(exception)". I've replaced these so they explicitly use str: "os.exit(str(exception))". drgn/cli.py:283: error: Argument 1 to "exit" has incompatible type "OSError"; expected "str | int | None" [arg-type] 2. Vermin complained that "int.is_integer()" was introduced 3.12. I surmised that it was unable to infer that its usage was guaranteed to be against a float, and the reason was due to the division operation against an integer. I changed the integer literal to a float literal, which resolved the issue. !2, 3.12 drgn/helpers/common/format.py 'int.is_integer' member requires !2, 3.12 Signed-off-by: Stephen Brennan <stephen.s.brennan@oracle.com>
- Loading branch information