Skip to content

Commit

Permalink
Lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
aaltat committed Mar 21, 2024
1 parent 877f34b commit ebad43f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/robotlibcore.py
Expand Up @@ -83,7 +83,7 @@ def add_library_components(self, library_components: List, translation: Optional
self.attributes[name] = self.attributes[kw_name] = kw

def __get_keyword_name(self, func: Callable, name: str, translation: dict):
if name in translation:
if name in translation: # noqa: SIM102
if new_name := translation[name].get("name"):
return new_name
return func.robot_name or name
Expand Down Expand Up @@ -236,7 +236,7 @@ def build(cls, function, translation: Optional[dict] = None):

@classmethod
def get_doc(cls, function, translation: dict):
if kw := cls._get_kw_transtation(function, translation):
if kw := cls._get_kw_transtation(function, translation): # noqa: SIM102
if "doc" in kw:
return kw["doc"]
return inspect.getdoc(function) or ""
Expand Down
1 change: 1 addition & 0 deletions utest/test_translations.py
Expand Up @@ -28,6 +28,7 @@ def test_translations_docs(lib: SmallLibrary):
kw = keywords["name_changed_again"]
assert kw.documentation == "This is also replaced.\n\nnew line."


def test_init_and_lib_docs(lib: SmallLibrary):
keywords = lib.keywords_spec
init = keywords["__init__"]
Expand Down

0 comments on commit ebad43f

Please sign in to comment.