From 50654bff8deeca8e8de98e267c058776b31acbfe Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Fri, 9 Jun 2023 09:21:03 -0400 Subject: [PATCH] Fix method return type (strict python noticed we return None here) (#27156) * Fix method return type (strict python noticed we return None here) * Fix typo * Fix a typo * Revert unintended repo change --------- Co-authored-by: Andrei Litvin --- scripts/py_matter_idl/matter_idl/lint/lint_rules_parser.py | 4 ++-- src/lib/support/StringSplitter.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/py_matter_idl/matter_idl/lint/lint_rules_parser.py b/scripts/py_matter_idl/matter_idl/lint/lint_rules_parser.py index 81a6158f13f542..9499e360399230 100755 --- a/scripts/py_matter_idl/matter_idl/lint/lint_rules_parser.py +++ b/scripts/py_matter_idl/matter_idl/lint/lint_rules_parser.py @@ -5,7 +5,7 @@ import xml.etree.ElementTree from dataclasses import dataclass from enum import Enum, auto -from typing import List, MutableMapping, Tuple, Union +from typing import List, MutableMapping, Optional, Tuple, Union from lark import Lark from lark.visitors import Discard, Transformer, v_args @@ -167,7 +167,7 @@ def GetLinterRules(self): def RequireAttribute(self, r: AttributeRequirement): self._required_attributes_rule.RequireAttribute(r) - def FindClusterCode(self, name: str) -> Tuple[str, int]: + def FindClusterCode(self, name: str) -> Optional[Tuple[str, int]]: if name not in self._cluster_codes: # Name may be a number. If this can be parsed as a number, accept it anyway try: diff --git a/src/lib/support/StringSplitter.h b/src/lib/support/StringSplitter.h index abeed6fa4567f9..8434f2b02c90dc 100644 --- a/src/lib/support/StringSplitter.h +++ b/src/lib/support/StringSplitter.h @@ -44,7 +44,7 @@ class StringSplitter } } - /// Returns the next character san + /// Returns the next character span /// /// out - contains the next element or a nullptr/0 sized span if /// no elements available