Add pyrefly suppressions

PiperOrigin-RevId: 966501583
Change-Id: I942ec198b369fb4a2f430070ee1002e7ad2d0c9d
This commit is contained in:
Hana Joo
2026-08-18 03:54:58 -07:00
committed by Copybara-Service
parent 06aa6c075f
commit e3590b7449
3 changed files with 19 additions and 19 deletions
+1 -1
View File
@@ -71,7 +71,7 @@ class ApiState:
return self._state
def export_definition(self):
return ApiDefinition(self.token, self._state, self.code, self._start,
return ApiDefinition(self.token, self._state, self.code, self._start, # pyrefly: ignore[bad-argument-type]
self._end, self.section, self.doc)
def start(self, state):
+3 -3
View File
@@ -277,7 +277,7 @@ def _lex(text: str, path: str) -> tuple[list[_Token], dict[int, str]]:
elif kind == 'punct':
tokens.append(_Token(value, value, line))
elif kind != 'ws':
tokens.append(_Token(kind, value, line))
tokens.append(_Token(kind, value, line)) # pyrefly: ignore[bad-argument-type]
pos = match.end()
tokens.append(_Token('eof', '', line))
return tokens, comments
@@ -686,7 +686,7 @@ def _validate_attr(schema: Schema, attr: Attr, namespaces: set[str]):
numeric and isinstance(attr.facets[facet], (int, float))):
err(f'facet {facet!r} requires a numeric attribute and value')
if 'min' in attr.facets and 'max' in attr.facets:
if attr.facets['min'] > attr.facets['max']:
if attr.facets['min'] > attr.facets['max']: # pyrefly: ignore[unsupported-operation]
err("facet 'min' cannot be greater than 'max'")
if attr.facets.get('positive') and not numeric:
err("facet 'positive' requires a numeric attribute")
@@ -699,7 +699,7 @@ def _validate_attr(schema: Schema, attr: Attr, namespaces: set[str]):
if attr.type == 'enum':
if not isinstance(attr.default, str):
err(f'default for enum attribute {attr.name!r} must be a keyword')
keywords = schema.enums[attr.target].keywords()
keywords = schema.enums[attr.target].keywords() # pyrefly: ignore[bad-index]
if attr.default not in keywords:
err(f'default {attr.default!r} is not a keyword of enum '
f'{attr.target!r}')