Skip to content

Commit

Permalink
#20 ignore flake8 forward refs
Browse files Browse the repository at this point in the history
  • Loading branch information
kwabenantim committed Mar 20, 2024
1 parent a443870 commit 3a4e0bf
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 14 deletions.
3 changes: 1 addition & 2 deletions cppwg/input/class_info.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

from typing import Any, Dict, Optional

from cppwg.input.cpp_type_info import CppTypeInfo
Expand All @@ -14,7 +13,7 @@ def __init__(self, name: str, class_config: Optional[Dict[str, Any]] = None):
super(CppClassInfo, self).__init__(name, class_config)

@property
def parent(self) -> "ModuleInfo":
def parent(self) -> "ModuleInfo": # noqa: F821
"""
Returns the parent module info object
"""
Expand Down
2 changes: 1 addition & 1 deletion cppwg/input/cpp_type_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def __init__(self, name: str, type_config: Optional[Dict[str, Any]] = None):

super(CppTypeInfo, self).__init__(name)

self.module_info: Optional["ModuleInfo"] = None
self.module_info: Optional["ModuleInfo"] = None # noqa: F821
self.source_file_full_path: Optional[str] = None
self.source_file: Optional[str] = None
self.name_override: Optional[str] = None
Expand Down
2 changes: 1 addition & 1 deletion cppwg/input/free_function_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def __init__(
super(CppFreeFunctionInfo, self).__init__(name, free_function_config)

@property
def parent(self) -> "ModuleInfo":
def parent(self) -> "ModuleInfo": # noqa: F821
"""
Returns the parent module info object
"""
Expand Down
4 changes: 2 additions & 2 deletions cppwg/input/method_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ def __init__(self, name: str, _):

super(CppMethodInfo, self).__init__(name)

self.class_info: Optional["CppClassInfo"] = None
self.class_info: Optional["CppClassInfo"] = None # noqa: F821

@property
def parent(self) -> "CppClassInfo":
def parent(self) -> "CppClassInfo": # noqa: F821
"""
Returns the parent class info object
"""
Expand Down
10 changes: 5 additions & 5 deletions cppwg/input/module_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ def __init__(self, name: str, module_config: Optional[Dict[str, Any]] = None):

super(ModuleInfo, self).__init__(name)

self.package_info: Optional["PackageInfo"] = None
self.package_info: Optional["PackageInfo"] = None # noqa: F821
self.source_locations: List[str] = None
self.class_info_collection: List["CppClassInfo"] = []
self.free_function_info_collection: List["CppFreeFunctionInfo"] = []
self.variable_info_collection: List["CppFreeFunctionInfo"] = []
self.class_info_collection: List["CppClassInfo"] = [] # noqa: F821
self.free_function_info_collection: List["CppFreeFunctionInfo"] = [] # fmt: skip # noqa: F821
self.variable_info_collection: List["CppFreeFunctionInfo"] = [] # noqa: F821
self.use_all_classes: bool = False
self.use_all_free_functions: bool = False
self.use_all_variables: bool = False
Expand All @@ -49,7 +49,7 @@ def __init__(self, name: str, module_config: Optional[Dict[str, Any]] = None):
setattr(self, key, value)

@property
def parent(self) -> "PackageInfo":
def parent(self) -> "PackageInfo": # noqa: F821
"""
Returns the parent package info object
"""
Expand Down
2 changes: 1 addition & 1 deletion cppwg/input/package_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def __init__(

self.name: str = name
self.source_locations: List[str] = None
self.module_info_collection: List["ModuleInfo"] = []
self.module_info_collection: List["ModuleInfo"] = [] # noqa: F821
self.source_root: str = source_root
self.source_hpp_patterns: List[str] = ["*.hpp"]
self.source_hpp_files: List[str] = []
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ dependencies = ["pyyaml >=6.0", "pygccxml >=2.2", "castxml >=0.4"]
requires-python = ">=3.8"

[project.optional-dependencies]
dev = ["flake8", "isort"]
dev = ["flake8", "flake8-bugbear", "isort"]
docs = ["sphinx", "sphinx-rtd-theme", "numpydoc"]

[project.scripts]
Expand Down
2 changes: 1 addition & 1 deletion tests/test_shapes.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def test_wrapper_generation(self) -> None:
self.assertTrue(os.path.isdir(wrapper_root_gen))

# Compare the generated files with reference files
for dirpath, dirnames, filenames in os.walk(wrapper_root_ref):
for dirpath, _, filenames in os.walk(wrapper_root_ref):
for filename in filenames:
if filename.endswith(".cppwg.cpp") or filename.endswith(".cppwg.hpp"):
file_ref = os.path.join(dirpath, filename)
Expand Down

0 comments on commit 3a4e0bf

Please sign in to comment.