mirror of
https://github.com/tiennm99/serena.git
synced 2026-10-13 10:16:00 +00:00
Use multi-return variant of should_include
This commit is contained in:
1 parent
9c3bd1bf0d
commit
e86f59507a
2 files changed
+8
-5
No files matched your search
@@ -255,6 +255,7 @@ ignore = [
|
||||
"W291",
|
||||
"W293",
|
||||
"B009",
|
||||
"SIM103", # forbids multiple returns
|
||||
]
|
||||
unfixable = [
|
||||
"F841",
|
||||
|
||||
@@ -98,11 +98,13 @@ class Symbol(ToStringMixin):
|
||||
result = []
|
||||
|
||||
def should_include(s: "Symbol") -> bool:
|
||||
name_match = (substring_matching and name in s.name) or name == s.name
|
||||
kind_include_match = include_kinds is None or s.symbol_kind in include_kinds
|
||||
kind_exclude_match = exclude_kinds is None or s.symbol_kind not in exclude_kinds
|
||||
|
||||
return name_match and kind_include_match and kind_exclude_match
|
||||
if not ((substring_matching and name in s.name) or name == s.name):
|
||||
return False
|
||||
if include_kinds is not None and s.symbol_kind not in include_kinds:
|
||||
return False
|
||||
if exclude_kinds is not None and s.symbol_kind in exclude_kinds:
|
||||
return False
|
||||
return True
|
||||
|
||||
def traverse(s: "Symbol") -> None:
|
||||
if should_include(s):
|
||||
|
||||
Reference in new issue
Block a user