Skip to content

Commit

Permalink
Fixed lint issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
LarsAsplund committed Mar 15, 2021
1 parent 8c670cf commit 5141f7c
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion tests/lint/test_mypy.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ class TestMyPy(unittest.TestCase):

@staticmethod
def test_mypy():
check_call([sys.executable, "-m", "mypy", "vunit"])
check_call([sys.executable, "-m", "mypy", "--namespace-packages", "vunit"])
2 changes: 1 addition & 1 deletion tools/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def parse_version(version_str):
"""
Create a 3-element tuple with the major,minor,patch version
"""
return tuple([int(elem) for elem in version_str.split(".")])
return tuple((int(elem) for elem in version_str.split(".")))


def set_version(version):
Expand Down
6 changes: 3 additions & 3 deletions vunit/parsing/tokenizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
import re
from vunit.ostools import read_file, file_exists, simplify_path

TokenType = collections.namedtuple("Token", ["kind", "value", "location"])


def Token(kind, value="", location=None): # pylint: disable=invalid-name
return TokenType(kind, value, location)
return collections.namedtuple("Token", ["kind", "value", "location"])(
kind, value, location
)


class TokenKind:
Expand Down
7 changes: 2 additions & 5 deletions vunit/vhdl/check/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,11 @@

from pathlib import Path
from glob import glob
import sys
from vunit import VUnit, ROOT
from vunit.check_preprocessor import CheckPreprocessor

sys.path.append(str(Path(__file__).parent / "tools"))

import generate_check_equal
import generate_check_match
import vunit.vhdl.check.tools.generate_check_equal as generate_check_equal
import vunit.vhdl.check.tools.generate_check_match as generate_check_match

generate_check_equal.main()
generate_check_match.main()
Expand Down
2 changes: 1 addition & 1 deletion vunit/vhdl/check/tools/generate_check_match.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from pathlib import Path
from string import Template
from generate_check_equal import replace_region
from vunit.vhdl.check.tools.generate_check_equal import replace_region

api_template = """ procedure check_match(
constant got : in $got_type;
Expand Down

0 comments on commit 5141f7c

Please sign in to comment.