Skip to content

Commit

Permalink
Enable Pylint in CI and fix its errors (riscv#311)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
Timmmm authored and Myrausman committed Nov 14, 2024
1 parent ced2ddd commit 3636a88
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,25 @@
import unittest
from unittest.mock import Mock, patch

from shared_utils import *
from shared_utils import (
InstrDict,
check_arg_lut,
check_overlapping_bits,
extract_isa_type,
find_extension_file,
handle_arg_lut_mapping,
initialize_encoding,
is_rv_variant,
overlaps,
pad_to_equal_length,
parse_instruction_line,
process_enc_line,
process_fixed_ranges,
process_standard_instructions,
same_base_isa,
update_encoding_for_fixed_range,
validate_bit_range,
)


class EncodingUtilsTest(unittest.TestCase):
Expand Down

0 comments on commit 3636a88

Please sign in to comment.