From 59bfda0fe07bb287005ab760b71eda9eba09b294 Mon Sep 17 00:00:00 2001 From: Zooxy Le Date: Fri, 3 May 2024 23:20:54 +0700 Subject: [PATCH] chore(docs): fixing docstring --- src/dictrule/built_in_rules/comment_rule.py | 14 +++++++------- src/dictrule/built_in_rules/eval_rule.py | 8 ++++---- src/dictrule/built_in_rules/for_in_rule.py | 4 ++-- src/dictrule/built_in_rules/indent_rule.py | 4 ++-- src/dictrule/context.py | 8 ++++---- src/dictrule/dr_property.py | 2 +- src/dictrule/generator.py | 6 +++--- 7 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/dictrule/built_in_rules/comment_rule.py b/src/dictrule/built_in_rules/comment_rule.py index 2d73b5d..c261673 100644 --- a/src/dictrule/built_in_rules/comment_rule.py +++ b/src/dictrule/built_in_rules/comment_rule.py @@ -99,7 +99,7 @@ def style() -> "CommentRule.Style": @property def prefix(self) -> str: - """Getter for `prefix` property""" + """Get the `prefix` property""" return self._prefix @@ -131,25 +131,25 @@ def style() -> "CommentRule.Style": @property def prefix(self) -> str: - """Getter for `prefix` property""" + """Get the `prefix` property""" return self._prefix @property def open_comment(self) -> str: - """Getter for `open_comment` property""" + """Get the `open_comment` property""" return self._open_comment @property def close_comment(self) -> str: - """Getter for `close_comment` property""" + """Get the `close_comment` property""" return self._close_comment @property def name(self) -> str: - """Getter for `name` property""" + """Get the `name` property""" return CommentRule.CONTEXT_NAME @@ -172,13 +172,13 @@ def __init__( @property def singleline(self) -> SinglelineComment: - """Getter for `singleline` property""" + """Get the `singleline` property""" return self._singleline @property def multiline(self) -> MultilineComment: - """Getter for `multiline` property""" + """Get the `multiline` property""" return self._multiline diff --git a/src/dictrule/built_in_rules/eval_rule.py b/src/dictrule/built_in_rules/eval_rule.py index ed4f385..bf42b4e 100644 --- a/src/dictrule/built_in_rules/eval_rule.py +++ b/src/dictrule/built_in_rules/eval_rule.py @@ -117,19 +117,19 @@ class ContextCase(Context.Case): @property def name(self) -> str: - """Getter for `name` property""" + """Get the `name` property""" return EvalRule.CONTEXT_NAME @property def evaluator_list(self) -> List["EvalRule.Evaluable"]: - """Getter for `evaluator_list` property""" + """Get the `evaluator_list` property""" return self._evaluator_list @property def fallback(self) -> Optional["EvalRule.Evaluable"]: - """Getter for `fallback` property""" + """Get the `fallback` property""" return self._fallback @@ -138,7 +138,7 @@ def __init__( evaluators: List["EvalRule.Evaluable"], fallback: Optional["EvalRule.Evaluable"] = None, ): - """Initialization method for `EvalRule.ContextCase`. + """Constructor method for `EvalRule.ContextCase`. Args: evaluators (List["EvalRule.Evaluable"]): List of evaluators. diff --git a/src/dictrule/built_in_rules/for_in_rule.py b/src/dictrule/built_in_rules/for_in_rule.py index 0a26d5e..4af36a4 100644 --- a/src/dictrule/built_in_rules/for_in_rule.py +++ b/src/dictrule/built_in_rules/for_in_rule.py @@ -87,13 +87,13 @@ class ForInEval(EvalRule.Evaluable): @property def name(self) -> str: - """Getter for `name` property""" + """Get the `name` property""" return self._var_name @property def prefix_matching(self) -> bool: - """Getter for `prefix_matching` property""" + """Get the `prefix_matching` property""" return True diff --git a/src/dictrule/built_in_rules/indent_rule.py b/src/dictrule/built_in_rules/indent_rule.py index 0f9b11f..963a126 100644 --- a/src/dictrule/built_in_rules/indent_rule.py +++ b/src/dictrule/built_in_rules/indent_rule.py @@ -44,7 +44,7 @@ class ContextCase(Context.Case): @property def name(self) -> str: - """Getter for `name` property""" + """Get the `name` property""" return "indent" @@ -62,7 +62,7 @@ def __init__( @property def num_spaces(self) -> int: - """Getter for `num_spaces` property""" + """Get the `num_spaces` property""" return self._num_spaces diff --git a/src/dictrule/context.py b/src/dictrule/context.py index 5409aaf..6f92651 100644 --- a/src/dictrule/context.py +++ b/src/dictrule/context.py @@ -23,7 +23,7 @@ class Case(ABC): @property def name(self) -> str: - """Getter for case name, matching the defined rule + """Get the case name, matching the defined rule Returns: str: A rule name @@ -35,7 +35,7 @@ def __init__( self, cases: List[Case], ) -> None: - """Initialization method of `Context` class + """Constructor method of `Context` class Args: cases (List[Case]): List of `Context.Case` to build the case map @@ -55,7 +55,7 @@ def __init__( @property def cases(self) -> List[Case]: - """Getter for `cases` property + """Get the `cases` property Returns: List[Case]: list of cases @@ -64,7 +64,7 @@ def cases(self) -> List[Case]: @property def case_map(self) -> Dict[str, Case]: - """Getter for `case_map` property + """Get the `case_map` property Returns: Dict[str, Case]: map of cases [name: str, case: Context.Case] diff --git a/src/dictrule/dr_property.py b/src/dictrule/dr_property.py index 80a8a69..1e10dc9 100644 --- a/src/dictrule/dr_property.py +++ b/src/dictrule/dr_property.py @@ -45,7 +45,7 @@ def __init__( optional: bool = False, prefix_matching: bool = False, ): - """Initialization method of `dr_property` + """Constructor method of `dr_property` Args: optional (bool, optional): Indicates if the property is optional diff --git a/src/dictrule/generator.py b/src/dictrule/generator.py index 82f3518..dff5a1e 100644 --- a/src/dictrule/generator.py +++ b/src/dictrule/generator.py @@ -58,7 +58,7 @@ def __init__( gen_rules: List[Union[str, Dict[str, Any]]], parse_rules: Optional[List[Rule]] = None, ): - """Initialization method for DictRule. + """Constructor method for DictRule. Args: gen_rules (List[Union[str, Dict[str, Any]]]): List or dictionary of rules @@ -76,13 +76,13 @@ def __init__( @property def parse_rules(self) -> List[Rule]: - """Getter for `parse_rules` property""" + """Get the `parse_rules` property""" return self._parse_rules @property def gen_rules(self) -> List[Union[str, Dict[str, Any]]]: - """Getter for `gen_rules` property""" + """Get the `gen_rules` property""" return self._gen_rules