chore: add cspell checking and make pass (#244)

* chore: add cspell checking and make pass

* chore(shorebird_code_push): minor improvements to example (#242)

* chore(shorebird_code_push): v2.0.2 (#243)

* chore: fix cspell

---------

Co-authored-by: Felix Angelov <felix@shorebird.dev>
This commit is contained in:
Eric Seidel
2024-11-20 10:50:16 -08:00
committed by GitHub
parent 7b124114ea
commit 6298d37d86
12 changed files with 98 additions and 27 deletions
+6
View File
@@ -12,6 +12,12 @@ jobs:
name: ✅ Semantic Pull Request
uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/semantic_pull_request.yml@v1
cspell:
name: 🔤 Check Spelling
uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/spell_check.yml@v1
with:
config: cspell.config.yaml
changes:
runs-on: ubuntu-latest
+65 -2
View File
@@ -1,7 +1,70 @@
$schema: https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json
version: '0.2'
ignorePaths: ['build', '**/*.g.dart']
ignorePaths:
- target
- build
- '**/*.g.dart'
# Flutter platform directories with per-platform build files
- windows
- macos
- linux
- ios
- android
words:
- subosito
- aarch
- androideabi
- apks
- armeabi
- armv7
- autogen
- bidiff
- bipatch
- bootable
- buildroot
- bundletool
- carryforward
- cbindgen
- cdylib
- classpath
- comde
- compatch
- Condvar
- datadir
- declspec
- Decompressor
- dllexport
- dlopen
- endtemplate
- eseidel
- ffigen
- gclient
- hdpi
- ifdef
- libapp
- libc
- libflutter
- libupdater
- logcat
- mockall
- mocktail
- oslog
- pubspec
- repr
- reqwest
- rollouts
- rustls
- rustup
- serde
- shorebirdtech
- sigstore
- staticlib
- subosito
- unbootable
- Verdana
- vmcode
- withf
- xlink
- zstandard
- zstd
- xcodeproj
- pbxproj
+1 -1
View File
@@ -182,7 +182,7 @@ This state machine tracks the process of checking for new patches. It is managed
by the code in `updater.rs` and does not have any on-disk state. It has the
following states:
1. Ready - Ready to check for udpates.
1. Ready - Ready to check for updates.
2. Send queued events (e.g., report that a patch succeeded or failed to boot)
a. Move to checking once events, if any, have been reported.
3. Checking for new patches - A PatchCheckRequest is issued but not completed.
+1
View File
@@ -1,3 +1,4 @@
// cspell:ignore rpkDZSLBRv2jWcc1gQpwdg
use anyhow::Context;
use std::fs;
use std::io::{Cursor, Read};
+7 -7
View File
@@ -10,11 +10,11 @@ struct CFile {
}
#[derive(Clone, Debug)]
pub struct CFileProvder {
pub struct CFileProvider {
pub file_callbacks: FileCallbacks,
}
impl ExternalFileProvider for CFileProvder {
impl ExternalFileProvider for CFileProvider {
fn open(&self) -> anyhow::Result<Box<dyn ReadSeek>> {
let handle = (self.file_callbacks.open)();
if handle.is_null() {
@@ -139,7 +139,7 @@ mod test {
fn test_open() {
reset_tests();
let file_provider = CFileProvder {
let file_provider = CFileProvider {
file_callbacks: FileCallbacks::new(),
};
let handle = file_provider.open().unwrap();
@@ -158,7 +158,7 @@ mod test {
OPEN_RET = std::ptr::null_mut();
}
let file_provider = CFileProvder {
let file_provider = CFileProvider {
file_callbacks: FileCallbacks::new(),
};
let result = file_provider.open();
@@ -170,7 +170,7 @@ mod test {
fn test_read() {
reset_tests();
let file_provider = CFileProvder {
let file_provider = CFileProvider {
file_callbacks: FileCallbacks::new(),
};
let mut handle = file_provider.open().unwrap();
@@ -187,7 +187,7 @@ mod test {
fn test_seek() {
reset_tests();
let file_provider = CFileProvder {
let file_provider = CFileProvider {
file_callbacks: FileCallbacks::new(),
};
let mut handle = file_provider.open().unwrap();
@@ -233,7 +233,7 @@ mod test {
fn test_seek_err() {
reset_tests();
let file_provider = CFileProvder {
let file_provider = CFileProvider {
file_callbacks: FileCallbacks::new(),
};
let mut handle = file_provider.open().unwrap();
+2 -2
View File
@@ -16,7 +16,7 @@ use std::path::PathBuf;
use crate::{updater, UpdateStatus};
use self::c_file::CFileProvder;
use self::c_file::CFileProvider;
mod c_file;
@@ -162,7 +162,7 @@ pub extern "C" fn shorebird_init(
log_on_error(
|| {
let config = app_config_from_c(c_params)?;
let file_provider = Box::new(CFileProvder {
let file_provider = Box::new(CFileProvider {
file_callbacks: c_file_callbacks,
});
let yaml_string = to_rust(c_yaml)?;
+1 -1
View File
@@ -79,7 +79,7 @@ mod test {
}
#[test]
fn read_errs_if_file_doesnt_exist() {
fn read_errs_if_file_does_not_exist() {
assert!(super::read::<TestStruct, _>(&Path::new("nonexistent.json")).is_err());
}
+7 -6
View File
@@ -57,13 +57,14 @@ struct PatchesState {
/// Abstracts the storage of patches on disk.
///
/// The impementation of this (PatchManager) should only be responsible for translating what is on
/// disk into a form that is useful for the updater and vice versa. Some business logic has crept in
/// in the form of validation, and we should consider moving that into a separate module.
/// The implementation of this (PatchManager) should only be responsible for
/// translating what is on disk into a form that is useful for the updater and
/// vice versa. Some business logic has crept in in the form of validation, and
/// we should consider moving that into a separate module.
#[cfg_attr(test, automock)]
pub trait ManagePatches {
/// Copies the patch file at file_path to the manager's directory structure sets
/// this patch as the next patch to boot.
/// Copies the patch file at file_path to the manager's directory structure
/// sets this patch as the next patch to boot.
///
/// The explicit lifetime is required for automock to work with Options.
/// See https://github.com/asomers/mockall/issues/61.
@@ -952,7 +953,7 @@ mod fall_back_tests {
manager.record_boot_start_for_patch(1)?;
manager.record_boot_success()?;
let patch_1_path = manager.patch_artifact_path(1);
std::fs::write(patch_1_path, "junkjunkjunk")?;
std::fs::write(patch_1_path, "junk junk junk")?;
// Download and fall back from patch 2
manager.add_patch_for_test(&temp_dir, 2)?;
+1
View File
@@ -1,3 +1,4 @@
// cspell:ignore pubin PKCS outform
use anyhow::{bail, Context, Result};
use base64::Engine;
use std::path::Path;
+1 -1
View File
@@ -403,7 +403,7 @@ mod tests {
let result = super::report_event_default(
// Make the request to an incorrectly formatted URL, which will
// trigger the same error as a lack of internet connection.
&patches_events_url("asdfasdf"),
&patches_events_url("does_not_exist"),
super::CreatePatchEventRequest {
event: PatchEvent {
app_id: "app_id".to_string(),
+5 -6
View File
@@ -17,12 +17,11 @@ fn updater_lock() -> &'static std::sync::Mutex<UpdaterLockState> {
// Note: it is not OK to ever ask for the Updater lock *while* holding the
// UpdateConfig lock because the updater thread *will* block on getting the
// UpdateConfig lock while holding the Updater lock. Allowing the inverse
// could cause a deadlock. We could add a check for that here by doing a
// tryLock on the UpdateConfig lock and erroring out if we can't get it, but
// that would probably have false postives since it is OK for some other call to
// be holding the UpdateConfig lock while another thread asks for the Updater
// lock.
// UpdateConfig lock while holding the Updater lock. Allowing the inverse could
// cause a deadlock. We could add a check for that here by doing a tryLock on
// the UpdateConfig lock and erroring out if we can't get it, but that would
// probably have false positives since it is OK for some other call to be
// holding the UpdateConfig lock while another thread asks for the Updater lock.
pub fn with_updater_thread_lock<F, R>(f: F) -> anyhow::Result<R>
where
F: FnOnce(&UpdaterLockState) -> anyhow::Result<R>,
+1 -1
View File
@@ -1,6 +1,6 @@
# 2.0.2
- fix: unbreak web platform
- fix: un-break web platform
- chore: minor improvements to example
# 2.0.1