-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(parse-utils): checking custom rules against file package names in…
…stead (#225)
- Loading branch information
1 parent
3cab9c0
commit 26829d9
Showing
14 changed files
with
107 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file.
66 changes: 66 additions & 0 deletions
66
example_repos/my_base_module/my_second_base_package_two/module_one.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
""" A basic module. """ | ||
from datetime import datetime | ||
from uuid import UUID | ||
from uuid import uuid4 | ||
|
||
from attrs import define | ||
from attrs import field | ||
|
||
import my_base_module.module_y | ||
import my_second_base_package.module_one.file_one | ||
from my_base_module.module_x import X | ||
from my_second_base_package.module_three import ModuleThree | ||
|
||
|
||
@define(slots=True) | ||
class ModuleOne: | ||
"""A basic class""" | ||
|
||
_id: UUID | None = field(factory=uuid4) | ||
_name: str | None = field(default="name") | ||
_description: str | None = field(default="description") | ||
_created_at: datetime | None = field(factory=datetime.now) | ||
|
||
def id(self): | ||
"""Get the id.""" | ||
return self._id | ||
|
||
def name(self): | ||
"""Get the name.""" | ||
return self._name | ||
|
||
def description(self): | ||
"""Get the description.""" | ||
return self._description | ||
|
||
def created_at(self): | ||
"""Get the created_at.""" | ||
return self._created_at | ||
|
||
def initialize_class_x(self) -> X: | ||
"""Initialize class x.""" | ||
return X( | ||
name=f"{self._name}: X", | ||
description=f"{self._description}: X", | ||
) | ||
|
||
def initialize_class_y(self) -> my_base_module.module_y.Y: | ||
"""Initialize class y.""" | ||
return my_base_module.module_y.Y( | ||
name=f"{self._name}: Y", | ||
description=f"{self._description}: Y", | ||
) | ||
|
||
def initialize_class_one(self) -> my_second_base_package.module_one.file_one.ModuleOne: | ||
"""Initialize class one.""" | ||
return my_second_base_package.module_one.file_one.ModuleOne( | ||
name=f"{self._name}: ModuleOne", | ||
description=f"{self._description}: ModuleOne", | ||
) | ||
|
||
def initialize_class_two(self) -> ModuleThree: | ||
"""Initialize class two.""" | ||
return ModuleThree( | ||
name=f"{self._name}: ModuleThree", | ||
description=f"{self._description}: ModuleThree", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters