aboutsummaryrefslogtreecommitdiff
path: root/parse.py
diff options
context:
space:
mode:
authorTim Hutt <timothy.hutt@codasip.com>2024-11-05 14:32:12 +0000
committerGitHub <noreply@github.com>2024-11-05 06:32:12 -0800
commit359a94356dba415cbd945e56126a326c59878e56 (patch)
treea1cbe073146a64c049db60f615acf6e1c2a94ad8 /parse.py
parent6bb00f9056db133a1bea48d2377316f49fb187df (diff)
downloadriscv-opcodes-359a94356dba415cbd945e56126a326c59878e56.zip
riscv-opcodes-359a94356dba415cbd945e56126a326c59878e56.tar.gz
riscv-opcodes-359a94356dba415cbd945e56126a326c59878e56.tar.bz2
Enable Pylint in CI and fix its errors (#311)
* Remove wildcard imports Use explicit imports rather than wildcards. This is more maintainable. * Enable Pylint in CI and fix its errors The main fixes were: * Specify encoding for all file opens. By default it depends on environment variables which is bad. * Use `with` to open files. Otherwise they don't necessarily get closed. There were also a few minor things like using `enumerate`, not using objects as default arguments, etc. In some cases I slightly refactored the code.
Diffstat (limited to 'parse.py')
-rwxr-xr-xparse.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/parse.py b/parse.py
index 4339e81..5704877 100755
--- a/parse.py
+++ b/parse.py
@@ -44,7 +44,7 @@ def main():
instr_dict = create_inst_dict(extensions, include_pseudo)
- with open("instr_dict.json", "w") as outfile:
+ with open("instr_dict.json", "w", encoding="utf-8") as outfile:
json.dump(add_segmented_vls_insn(instr_dict), outfile, indent=2)
instr_dict = collections.OrderedDict(sorted(instr_dict.items()))