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

Method has_valid_syntax

crates/ruff_python_parser/src/lib.rs:430–432  ·  view source on GitHub ↗

Returns `true` if the parsed source code is valid i.e., it has no [`ParseError`]s. Note that this does not include version-related [`UnsupportedSyntaxError`]s. See [`Parsed::has_no_syntax_errors`] for a version that takes these into account.

(&self)

Source from the content-addressed store, hash-verified

428 ///
429 /// See [`Parsed::has_no_syntax_errors`] for a version that takes these into account.
430 pub fn has_valid_syntax(&self) -> bool {
431 self.errors.is_empty()
432 }
433
434 /// Returns `true` if the parsed source code is invalid i.e., it has [`ParseError`]s.
435 ///

Callers 8

has_invalid_syntaxMethod · 0.80
has_no_syntax_errorsMethod · 0.80
as_resultMethod · 0.80
into_resultMethod · 0.80
check_pathFunction · 0.80
lint_onlyFunction · 0.80
lint_fixFunction · 0.80
do_fuzzFunction · 0.80

Calls 1

is_emptyMethod · 0.45

Tested by

no test coverage detected