Skip to content

Commit 5b93a9e

Browse files
committed
Replace pylint and pycodestyle with ruff. ruff is much faster, and supports a lot more checks. Apply a lot of ruff fixes:
* Fix `RenderTraceBase` name collision and fix some broken tests. * Delete some unused code and variables. * Rename some unused variables to `_`. * Remove some unnecessary calls to `len`. * Remove unused imports. * Sort imports. * Define `__all__` in `__init__.py`. * Simplify `tox.ini`.
1 parent bde52d6 commit 5b93a9e

55 files changed

Lines changed: 427 additions & 413 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#
1313
import os
1414
import sys
15+
1516
sys.path.insert(0, os.path.abspath('..'))
1617

1718

examples/example1-combologic.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"""
1111

1212
import random
13+
1314
import pyrtl
1415

1516
# The basic idea of PyRTL is to specify the component of a some hardware block

examples/example1.2-wire-struct.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"""
99

1010
import inspect
11+
1112
import pyrtl
1213

1314
# Motivation

examples/example2-counter.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
import pyrtl
1010

11-
1211
# Let's just dive right in.
1312

1413
def one_bit_add(a, b, carry_in):

examples/example3-statemachine.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"""
88

99
import enum
10+
1011
import pyrtl
1112

1213
token_in = pyrtl.Input(1, 'token_in')

examples/example4-debuggingtools.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@
66
PyRTL comes with various features to help you find mistakes.
77
"""
88

9-
import random
109
import io
11-
from pyrtl.rtllib import adders, multipliers
10+
import random
11+
1212
import pyrtl
13+
from pyrtl.rtllib import adders, multipliers
1314

1415
random.seed(93729473) # used to make random calls deterministic for this example
1516

examples/example5-introspection.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import pyrtl
44

5-
65
# The following example shows how PyRTL can be used to make some interesting
76
# hardware structures using Python introspection. In particular, this example
87
# makes a N-stage pipeline structure. Any specific pipeline is then a derived

examples/example8-verilog.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
that make doing netlist-level transforms and analysis directly in PyRTL easy.
88
"""
99

10-
import random
1110
import io
11+
import random
12+
1213
import pyrtl
1314

1415
# ---- Importing From Verilog ----

examples/example9-transforms-draft.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1+
import random
12

23
import pyrtl
34
from pyrtl import transform
45

56

67
def insert_random_inversions(rate=0.5):
7-
import random
88

99
def randomly_replace(wire):
1010
if random.random() < rate:

ipynb-examples/example1-combologic.ipynb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"outputs": [],
4040
"source": [
4141
"import random\n",
42+
"\n",
4243
"import pyrtl"
4344
]
4445
},

0 commit comments

Comments
 (0)