Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(publish): rename --no-fast-check to --no-zap #22214

Merged
merged 4 commits into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cli/tests/testdata/publish/invalid_fast_check.out
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ error[zap-missing-explicit-return-type]: missing explicit return type in the pub
info: all functions in the public API must have an explicit return type
docs: https://jsr.io/go/zap-missing-explicit-return-type

This package contains Fast Check errors. You can skip Fast Check with --no-fast-check flag.
bartlomieju marked this conversation as resolved.
Show resolved Hide resolved
bartlomieju marked this conversation as resolved.
Show resolved Hide resolved

error: Found 1 problem
8 changes: 8 additions & 0 deletions cli/tools/registry/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,23 @@ impl PublishDiagnosticsCollector {
sources: &dyn ParsedSourceStore,
) -> Result<(), AnyError> {
let mut errors = 0;
let mut has_fast_check_error = false;
let diagnostics = self.diagnostics.lock().unwrap().take();
let sources = SourceTextParsedSourceStore(sources);
for diagnostic in diagnostics {
eprint!("{}", diagnostic.display(&sources));
if matches!(diagnostic.level(), DiagnosticLevel::Error) {
errors += 1;
}
if matches!(diagnostic, PublishDiagnostic::FastCheck(..)) {
has_fast_check_error = true;
}
}
if errors > 0 {
if has_fast_check_error {
eprintln!("This package contains Fast Check errors. You can skip Fast Check with --no-fast-check flag.\n");
}

Err(anyhow!(
"Found {} problem{}",
errors,
Expand Down
Loading