diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2024-02-01 03:16:52 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-01 02:16:52 +0000 |
commit | 830d096b66696ad9f4e67b3ed8460fb1ff7a9170 (patch) | |
tree | efa513f071b65888f407fbe1f54fc4c2531c471b /cli/tools/registry/diagnostics.rs | |
parent | fddbb018c1f2467eef49fdef46488337b869fc38 (diff) |
fix(publish): rename --no-fast-check to --no-zap (#22214)
Also prints an information about the flag when there are `zap` errors.
Diffstat (limited to 'cli/tools/registry/diagnostics.rs')
-rw-r--r-- | cli/tools/registry/diagnostics.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/cli/tools/registry/diagnostics.rs b/cli/tools/registry/diagnostics.rs index bd2a64d35..643a4fb2d 100644 --- a/cli/tools/registry/diagnostics.rs +++ b/cli/tools/registry/diagnostics.rs @@ -36,6 +36,7 @@ impl PublishDiagnosticsCollector { sources: &dyn ParsedSourceStore, ) -> Result<(), AnyError> { let mut errors = 0; + let mut has_zap_errors = false; let diagnostics = self.diagnostics.lock().unwrap().take(); let sources = SourceTextParsedSourceStore(sources); for diagnostic in diagnostics { @@ -43,8 +44,20 @@ impl PublishDiagnosticsCollector { if matches!(diagnostic.level(), DiagnosticLevel::Error) { errors += 1; } + if matches!(diagnostic, PublishDiagnostic::FastCheck(..)) { + has_zap_errors = true; + } } if errors > 0 { + if has_zap_errors { + eprintln!( + "This package contains Zap errors. Although conforming to Zap will" + ); + eprintln!("significantly improve the type checking performance of your library,"); + eprintln!("you can choose to skip it by providing the --no-zap flag."); + eprintln!(); + } + Err(anyhow!( "Found {} problem{}", errors, |