Skip to content

Commit

Permalink
exclude self
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulinaPacyna committed Nov 3, 2023
1 parent 2bbc97d commit 70d09f2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions annotation_checker/checkers.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Checker(ABC):
def __init__(
self,
exclude_parameters: str = "",
exclude_self: bool = True,
exclude_self: bool = False,
exclude_by_name: str = "",
) -> None:
self._errors = []
Expand Down Expand Up @@ -80,7 +80,7 @@ class FunctionChecker(Checker):
def __init__(
self,
exclude_parameters: str = "",
exclude_self: bool = True,
exclude_self: bool = False,
exclude_by_name: str = "",
) -> None:
super().__init__(
Expand Down Expand Up @@ -110,10 +110,10 @@ def __check_args(self, function: ast.FunctionDef) -> None:
----------
function (ast.FunctionDef): the function to be checked
"""
args = function.args
args = function.args.args
if self._exclude_self:
args = args[1:]
for argument in args.args:
for argument in args:
if not argument.annotation:
if self.__check_if_not_excluded(argument.arg):
self._errors.append(
Expand Down
2 changes: 1 addition & 1 deletion annotation_checker/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def check_annotated(
exclusion_comment=exclusion_comment,
)
function_checker = FunctionChecker(
exclude_parameters=exclude_parameters, exclude_self=exclude_self
exclude_parameters=exclude_parameters, exclude_self=False
)
class_checker = ClassChecker(
exclude_parameters=exclude_parameters, exclude_self=exclude_self
Expand Down

0 comments on commit 70d09f2

Please sign in to comment.