pub struct CheckInfo {
pub errors: Vec<String>,
pub warnings: Vec<String>,
pub deps: Vec<PathBuf>,
pub lints: Vec<String>,
pub requires: Vec<RequireSite>,
pub error_fixes: Vec<Option<Fix>>,
pub lint_fixes: Vec<Option<Fix>>,
pub dependency_errors: Vec<DependencyError>,
}Expand description
Result of type-checking one .tl file.
Fields§
§errors: Vec<String>file:line:col: message for syntax and type errors.
warnings: Vec<String>file:line:col: message for warnings (non-fatal).
deps: Vec<PathBuf>Files pulled in via require during checking (.tl / .d.tl / .lua).
lints: Vec<String>htl lint findings (nil-index, enum-exhaustive). Advisory unless the caller
promotes them (htl check --strict, include_tl!).
requires: Vec<RequireSite>Every require("<literal>") in the file and where the checker resolved it.
Input to require_cycles.
error_fixes: Vec<Option<Fix>>error_fixes[i] is the fix for errors[i], when the error has one.
lint_fixes: Vec<Option<Fix>>lint_fixes[i] is the fix for lints[i], when the lint has one.
dependency_errors: Vec<DependencyError>Type errors in the modules this check pulled in through require, transitively,
each dependency once. Not in errors, and not what ok answers: the
file itself checked, and generates; it is the require of that module that will
raise at run time (Htl::install_searcher), which is why a caller reporting on a
project treats these as errors too (htl check, include_tl!).
Implementations§
Source§impl CheckInfo
impl CheckInfo
Sourcepub fn ok(&self) -> bool
pub fn ok(&self) -> bool
true when nothing failed the check — errors only. Warnings and lints are the
caller’s to promote (clean is the stricter question), so this is
what decides whether generated code may be run.
Sourcepub fn diagnostics(&self) -> Vec<Diagnostic>
pub fn diagnostics(&self) -> Vec<Diagnostic>
Everything this check found about the file itself, structured, in the order the text output says it: warnings, then lints, then errors.
Errors in what the file required are not here — they belong to the module they
are in, and it is the reporting caller that decides how to say them
(dependency_errors).
Sourcepub fn error_diagnostics(&self) -> Vec<Diagnostic>
pub fn error_diagnostics(&self) -> Vec<Diagnostic>
errors with their positions and their fixes.
Sourcepub fn warning_diagnostics(&self) -> Vec<Diagnostic>
pub fn warning_diagnostics(&self) -> Vec<Diagnostic>
warnings with their positions. Warnings carry no fix.
Sourcepub fn lint_diagnostics(&self) -> Vec<Diagnostic>
pub fn lint_diagnostics(&self) -> Vec<Diagnostic>
lints with their positions, their rule names and their fixes.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CheckInfo
impl RefUnwindSafe for CheckInfo
impl Send for CheckInfo
impl Sync for CheckInfo
impl Unpin for CheckInfo
impl UnsafeUnpin for CheckInfo
impl UnwindSafe for CheckInfo
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more