MCPcopy Create free account
hub / github.com/astral-sh/ruff / has_syntax_errors

Method has_syntax_errors

crates/ruff_python_parser/src/lib.rs:455–457  ·  view source on GitHub ↗

Returns `true` if the parsed source code contains any [`ParseError`]s *or [`UnsupportedSyntaxError`]s. See [`Parsed::has_invalid_syntax`] for a version specific to [`ParseError`]s.

(&self)

Source from the content-addressed store, hash-verified

453 ///
454 /// See [`Parsed::has_invalid_syntax`] for a version specific to [`ParseError`]s.
455 pub fn has_syntax_errors(&self) -> bool {
456 !self.has_no_syntax_errors()
457 }
458
459 /// Returns the [`Parsed`] output as a [`Result`], returning [`Ok`] if it has no syntax errors,
460 /// or [`Err`] containing the first [`ParseError`] encountered.

Callers 4

test_valid_syntaxFunction · 0.80
fix_allFunction · 0.80
recheck_filesFunction · 0.80
suppress_all_inFunction · 0.80

Calls 1

has_no_syntax_errorsMethod · 0.80

Tested by 1

test_valid_syntaxFunction · 0.64