Skip to content

Commit 994283e

Browse files
committed
Fixed linting related to too many positional arguments
1 parent 80bba05 commit 994283e

File tree

19 files changed

+64
-28
lines changed

19 files changed

+64
-28
lines changed

tools/doc_support.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ def highlight_code(
6666
code_path,
6767
output_path,
6868
snippet_name=None,
69+
*,
6970
line_no_offset=None,
7071
functions=None,
7172
types=None,

vunit/cached.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from vunit.ostools import read_file
1414

1515

16-
def cached(key, function, file_name, encoding, database=None, newline=None):
16+
def cached(key, function, file_name, encoding, *, database=None, newline=None):
1717
"""
1818
Call function with file content if an update is needed
1919
"""

vunit/configuration.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ def __init__( # pylint: disable=too-many-arguments
3434
self,
3535
name,
3636
design_unit,
37+
*,
3738
generics=None,
3839
sim_options=None,
3940
pre_config=None,
@@ -282,6 +283,7 @@ def _check_architectures(design_unit):
282283
def add_config( # pylint: disable=too-many-arguments
283284
self,
284285
name,
286+
*,
285287
generics=None,
286288
pre_config=None,
287289
post_check=None,

vunit/design_unit.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ def __init__(
5252
name,
5353
source_file,
5454
unit_type,
55+
*,
5556
is_primary=True,
5657
primary_design_unit=None,
5758
):
@@ -66,7 +67,7 @@ class Entity(VHDLDesignUnit):
6667
"""
6768

6869
def __init__(self, name, source_file, generic_names=None):
69-
VHDLDesignUnit.__init__(self, name, source_file, "entity", True)
70+
VHDLDesignUnit.__init__(self, name, source_file, "entity", is_primary=True)
7071
self.generic_names = [] if generic_names is None else generic_names
7172
self._add_architecture_callback = None
7273
self._architecture_names = {}

vunit/parsing/verilog/parser.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ class VerilogDesignFile(object):
164164

165165
def __init__( # pylint: disable=too-many-arguments
166166
self,
167+
*,
167168
modules=None,
168169
packages=None,
169170
imports=None,

vunit/parsing/verilog/preprocess.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def _preprocess(self, tokens, defines=None, include_paths=None, included_files=N
8181

8282
return result
8383

84-
def preprocessor( # pylint: disable=too-many-arguments,too-many-branches
84+
def preprocessor( # pylint: disable=too-many-arguments,too-many-branches,too-many-positional-arguments
8585
self, token, stream, defines, include_paths, included_files
8686
):
8787
"""
@@ -162,7 +162,7 @@ def _skip_protected_region(stream):
162162
if token.value == "end_protected":
163163
return
164164

165-
def expand_macro( # pylint: disable=too-many-arguments
165+
def expand_macro( # pylint: disable=too-many-arguments,too-many-positional-arguments
166166
self, macro_token, stream, defines, include_paths, included_files
167167
):
168168
"""
@@ -254,7 +254,9 @@ def determine_if_taken(if_token, arg):
254254
stream.skip_while(NEWLINE)
255255
return result
256256

257-
def include(self, token, stream, include_paths, included_files, defines): # pylint: disable=too-many-arguments
257+
def include(
258+
self, token, stream, include_paths, included_files, defines
259+
): # pylint: disable=too-many-arguments,too-many-positional-arguments
258260
"""
259261
Handle `include directive
260262
"""

vunit/project.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ def add_source_file( # pylint: disable=too-many-arguments
113113
self,
114114
file_name,
115115
library_name,
116+
*,
116117
file_type="vhdl",
117118
include_dirs=None,
118119
defines=None,

vunit/sim_if/ghdl.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ def __init__( # pylint: disable=too-many-arguments
9393
self,
9494
output_path,
9595
prefix,
96+
*,
9697
gui=False,
9798
viewer_fmt=None,
9899
viewer_args="",
@@ -286,7 +287,7 @@ def compile_vhdl_file_command(self, source_file):
286287

287288
def _get_command(
288289
self, config, output_path, elaborate_only, ghdl_e, test_suite_name, wave_file
289-
): # pylint: disable=too-many-branches,too-many-arguments
290+
): # pylint: disable=too-many-branches,too-many-arguments,too-many-positional-arguments
290291
"""
291292
Return GHDL simulation command
292293
"""
@@ -392,9 +393,12 @@ def simulate(self, output_path, test_suite_name, config, elaborate_only): # pyl
392393
status = False
393394

394395
if config.sim_options.get(self.name + ".gtkwave_script.gui", None):
395-
LOGGER.warning("%s.gtkwave_script.gui is deprecated and will be removed "
396-
"in a future version, use %s.viewer_script.gui instead",
397-
self.name, self.name)
396+
LOGGER.warning(
397+
"%s.gtkwave_script.gui is deprecated and will be removed "
398+
"in a future version, use %s.viewer_script.gui instead",
399+
self.name,
400+
self.name,
401+
)
398402

399403
if self._gui and not elaborate_only:
400404
cmd = [self._get_viewer(config)] + shlex.split(self._viewer_args) + [data_file_name]

vunit/sim_if/incisive.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def supports_vhdl_contexts():
8484
return False
8585

8686
def __init__( # pylint: disable=too-many-arguments
87-
self, prefix, output_path, gui=False, log_level=None, cdslib=None, hdlvar=None
87+
self, prefix, output_path, *, gui=False, log_level=None, cdslib=None, hdlvar=None
8888
):
8989
SimulatorInterface.__init__(self, output_path, gui)
9090
self._prefix = prefix

vunit/sim_if/nvc.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def find_prefix_from_path(cls):
7474
return cls.find_toolchain([cls.executable])
7575

7676
def __init__( # pylint: disable=too-many-arguments
77-
self, output_path, prefix, num_threads, gui=False, viewer_fmt=None, viewer_args="", viewer=None
77+
self, output_path, prefix, *, num_threads, gui=False, viewer_fmt=None, viewer_args="", viewer=None
7878
):
7979
SimulatorInterface.__init__(self, output_path, gui)
8080
if viewer_fmt == "ghw":
@@ -305,9 +305,12 @@ def simulate(
305305
status = False
306306

307307
if config.sim_options.get(self.name + ".gtkwave_script.gui", None):
308-
LOGGER.warning("%s.gtkwave_script.gui is deprecated and will be removed "
309-
"in a future version, use %s.viewer_script.gui instead",
310-
self.name, self.name)
308+
LOGGER.warning(
309+
"%s.gtkwave_script.gui is deprecated and will be removed "
310+
"in a future version, use %s.viewer_script.gui instead",
311+
self.name,
312+
self.name,
313+
)
311314

312315
if self._gui and not elaborate_only:
313316
cmd = [self._get_viewer(config)] + shlex.split(self._viewer_args) + [str(wave_file)]

0 commit comments

Comments
 (0)