Skip to content

Your Android phone and your Windows PC, working as one. Local-first, end-to-end encrypted, no account.

Check generated files and work offline in check.ps1

Bee18ec49b04150
diff --git a/deny.toml b/deny.toml
index 3eb9e8f..0afef26 100644
--- a/deny.toml
+++ b/deny.toml
@@ -34,6 +34,8 @@ confidence-threshold = 0.9
# never end up in the MPL core by accident.
exceptions = [
{ crate = "nectarlink-cli", allow = ["GPL-3.0-or-later"] },
+ { crate = "nectarlink-desktop", allow = ["GPL-3.0-or-later"] },
+ { crate = "xtask", allow = ["GPL-3.0-or-later"] },
{ crate = "s1-qt-rust", allow = ["GPL-3.0-or-later"] },
]
diff --git a/scripts/check.ps1 b/scripts/check.ps1
index 8be5114..caef1e8 100644
--- a/scripts/check.ps1
+++ b/scripts/check.ps1
@@ -1,8 +1,9 @@
# SPDX-License-Identifier: GPL-3.0-or-later
<#
.SYNOPSIS
- Runs the same checks as CI: formatting, lints, tests, license headers and
- the dependency policy. Exits non-zero if any step fails.
+ Runs the same checks as CI: formatting, lints, tests, license headers,
+ generated files and the dependency policy. Exits non-zero if any step
+ fails.
.DESCRIPTION
Every step runs even after a failure, so one run shows everything that
@@ -88,12 +89,19 @@ try {
Invoke-Step "Tests" { cargo test --workspace --locked }
}
Invoke-Step "License headers" { Test-SpdxHeaders }
+ Invoke-Step "Generated files" { cargo xtask tokens --check }
if (-not $Fast) {
Invoke-Step "Dependency policy" {
if (-not (Get-Command cargo-deny -ErrorAction SilentlyContinue)) {
throw "cargo-deny is not installed: cargo install --locked cargo-deny"
}
- cargo deny --log-level error check
+ $output = cargo deny --log-level error check 2>&1 | Out-String
+ if ($LASTEXITCODE -ne 0 -and $output -match "unable to access|Could not resolve host|failed to fetch") {
+ # Offline: check against the advisories fetched last time.
+ Write-Host " advisory database unreachable; using the cached copy" -ForegroundColor Yellow
+ $output = cargo deny --offline --log-level error check 2>&1 | Out-String
+ }
+ Write-Host $output.Trim()
}
}
if ($Arm64) {