Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linter static method issues #41

Draft
wants to merge 2 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions pyEDAA/ProjectModel/Xilinx/Vivado.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ def _ParseFile(self, fileNode, fileset):
else:
self._ParseDefaultFile(fileNode, filePath, fileset)

def _ParseVHDLFile(self, fileNode, path, fileset):
@staticmethod
def _ParseVHDLFile(fileNode, path, fileset):
vhdlFile = VHDLSourceFile(path)
fileset.AddFile(vhdlFile)
usedInAttr = vhdlFile[UsedInAttribute]
Expand All @@ -169,19 +170,24 @@ def _ParseVHDLFile(self, fileNode, path, fileset):
elif fileAttribute.getAttribute("Val") == "UsedIn":
usedInAttr.append(fileAttribute.getAttribute("Val"))

def _ParseDefaultFile(self, _, path, fileset):
@staticmethod
def _ParseDefaultFile(_, path, fileset):
File(path, fileSet=fileset)

def _ParseXDCFile(self, _, path, fileset):
@staticmethod
def _ParseXDCFile(_, path, fileset):
XDCConstraintFile(path, fileSet=fileset)

def _ParseVerilogFile(self, _, path, fileset):
@staticmethod
def _ParseVerilogFile(_, path, fileset):
VerilogSourceFile(path, fileSet=fileset)

def _ParseXCIFile(self, _, path, fileset):
@staticmethod
def _ParseXCIFile(_, path, fileset):
IPCoreInstantiationFile(path, fileSet=fileset)

def _ParseFileSetConfig(self, fileNode, fileset):
@staticmethod
def _ParseFileSetConfig(fileNode, fileset):
for option in fileNode.childNodes:
if option.nodeType == Node.ELEMENT_NODE and option.tagName == "Option":
if option.getAttribute("Name") == "TopModule":
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/Design.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ def test_Files(self):


class Validate(TestCase):
def test_Design(self):
@staticmethod
def test_Design():
project = Project("project", rootDirectory=Path("tests/project"))
design = Design("design", directory=Path("designA"), project=project)

Expand Down
3 changes: 2 additions & 1 deletion tests/unit/File.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ def test_ResolveDirectory(self):


class Validate(TestCase):
def test_File(self):
@staticmethod
def test_File():
project = Project("project", rootDirectory=Path("tests/project"))
design = Design("design", directory=Path("designA"), project=project)
fileSet = FileSet("fileset", design=design)
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/FileSet.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,8 @@ def test_SourceFile(self):


class Validate(TestCase):
def test_FileSet(self):
@staticmethod
def test_FileSet():
project = Project("project", rootDirectory=Path("tests/project"))
design = Design("design", directory=Path("designA"), project=project)
fileSet = FileSet("fileset", design=design)
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/Files.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ def test_GetVersionFromFileSet(self):

self.assertEqual(vhdlVersion, file.VHDLVersion)

def test_Validate(self):
@staticmethod
def test_Validate():
project = Project("project", rootDirectory=Path("tests/project"), vhdlVersion=VHDLVersion.VHDL2019)
design = Design("design", directory=Path("designA"), project=project)
vhdlLibrary = VHDLLibrary("library", design=design)
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/Project.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ def test_ResolveDirectory(self):


class Validate(TestCase):
def test_Project(self):
@staticmethod
def test_Project():
project = Project("project", rootDirectory=Path("tests/project"))

project.Validate()