Skip to content

Commit

Permalink
codespell lol
Browse files Browse the repository at this point in the history
  • Loading branch information
hnez committed Aug 9, 2024
1 parent ca72596 commit ec80b7f
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 17 deletions.
3 changes: 3 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[codespell]
skip = ./.git/*,./target/*
ignore-words-list = crate,ser
2 changes: 1 addition & 1 deletion src/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::sync::{Arc, Mutex};
use octocrab::models::InstallationId;
use octocrab::Octocrab;

use create::config::Config;
use crate::config::Config;

pub struct Auth {
app: Arc<Octocrab>,
Expand Down
5 changes: 5 additions & 0 deletions src/config/github.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,17 @@ use serde::Deserialize;

use super::duration_human;

fn default_timeout() -> Duration {
Duration::from_secs(15 * 60)
}

#[derive(Deserialize)]
#[serde(deny_unknown_fields)]
pub struct GitHubConfig {
pub app_id: u64,
pub jwt_key_file: String,
pub webhook_secret: String,
#[serde(default = "default_timeout")]
#[serde(deserialize_with = "duration_human::deserialize")]
pub polling_interval: Duration,
}
2 changes: 1 addition & 1 deletion src/config/machine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::path::PathBuf;
use serde::Deserialize;

use super::size_in_bytes::SizeInBytes;
use create::machines::Triplet;
use crate::machines::Triplet;

#[derive(Deserialize)]
pub struct SetupTemplate {
Expand Down
8 changes: 4 additions & 4 deletions src/ingres/poll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ use chrono::{TimeDelta, Utc};
use log::{debug, error, info};
use octocrab::models::RunId;

use create::auth::Auth;
use create::config::{Config, Repository};
use create::jobs::Manager as JobManager;
use create::machines::OwnerAndRepo;
use crate::auth::Auth;
use crate::config::{Config, Repository};
use crate::jobs::Manager as JobManager;
use crate::machines::OwnerAndRepo;

/// The cut-off point when fetching the initial run list.
/// Once a run is encountered that is older than this the search will stop.
Expand Down
8 changes: 4 additions & 4 deletions src/ingres/webhook.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ use tokio::net::unix::ReadHalf;
use tokio::net::{UnixListener, UnixStream};
use tokio::time::timeout;

use create::auth::Auth;
use create::config::{Config, ConfigFile};
use create::jobs::Manager as JobManager;
use create::machines::OwnerAndRepo;
use crate::auth::Auth;
use crate::config::{Config, ConfigFile};
use crate::jobs::Manager as JobManager;
use crate::machines::OwnerAndRepo;

const WEBHOOK_TIMEOUT: Duration = Duration::from_secs(5);
const WEBHOOK_SIZE_LIMIT: u64 = 4 * 1024 * 1024;
Expand Down
2 changes: 1 addition & 1 deletion src/jobs/job.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use octocrab::models::workflows::Status;
use octocrab::models::{JobId, RunId};

use create::machines::Triplet;
use crate::machines::Triplet;

pub(super) struct Job {
triplet: Triplet,
Expand Down
4 changes: 2 additions & 2 deletions src/jobs/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ use octocrab::models::{JobId, RunId};
use tokio::task::JoinHandle;

use super::job::Job;
use create::machines::Triplet;
use create::machines::{Manager as MachineManager, OwnerAndRepo};
use crate::machines::Triplet;
use crate::machines::{Manager as MachineManager, OwnerAndRepo};

// The `status_feedback()` method is called for each webhook event
// and each job that comes up in a poll.
Expand Down
4 changes: 2 additions & 2 deletions src/machines/machine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ use tokio::{process::Command, task::AbortHandle};
use super::manager::{Machines, Rescheduler};
use super::run_dir::RunDir;
use super::triplet::Triplet;
use create::auth::Auth;
use create::config::{ConfigFile, MachineConfig};
use crate::auth::Auth;
use crate::config::{ConfigFile, MachineConfig};

// The arguments used to start the qemu process.
//
Expand Down
2 changes: 1 addition & 1 deletion src/machines/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use log::{debug, error, info, warn};

use super::triplet::Triplet;
use super::{machine::Machine, OwnerAndRepo};
use create::{auth::Auth, config::Config};
use crate::{auth::Auth, config::Config};

// Machines should go from being booted to being registered with GitHub
// in less than 15 minutes.
Expand Down
2 changes: 1 addition & 1 deletion src/machines/run_dir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::path::{Path, PathBuf};
use log::{debug, error, info, warn};
use reflink_copy::reflink;

use create::config::SeedBasePolicy;
use crate::config::SeedBasePolicy;

use super::config_fs::ConfigFs;
use super::machine::Machine;
Expand Down

0 comments on commit ec80b7f

Please sign in to comment.