forked from lowRISC/opentitan
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[reggen] Make reggen library MyPy-clean
Fix some mypy errors in the reggen library. It looks like the version of MyPy that we're using in CI at the moment isn't new enough to notice the problems, so we won't really see much change from this commit. However, these changes fix things with 1.0.1 (the latest release), which spat out lots of messages without them. Getting things happy again is mostly a case of adding some types to guide the tool so that it knows what's going on. There's also a small re-write in gen_selfdoc.py: there, the doc_tbl_head() function used an optional int as a way of encoding a bool. This seemed a bit silly (and hard to encode!), so I've switched it to use True/False instead. Finally, we fix a type error in register.py, where the code was missing some parentheses and testing a function (rather than its return value) against None. One slightly odd thing is the change to access.py. There, the problem was that self.value[1].name wasn't known to be a string. It turns out that this depends on the Python version(!) and is tracked in python/mypy#12483. Using a do-nothing cast with str() silences things. Signed-off-by: Rupert Swarbrick <rswarbrick@lowrisc.org>
- Loading branch information
1 parent
2030c80
commit e3ab620
Showing
5 changed files
with
32 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters