Skip to content

Commit

Permalink
build: Update to Rust v1.63 (#252)
Browse files Browse the repository at this point in the history
* Update configs.

* Update lints.
  • Loading branch information
milesj committed Aug 14, 2022
1 parent 793cfb0 commit a857630
Show file tree
Hide file tree
Showing 19 changed files with 79 additions and 67 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/moon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
restore-keys: ${{ runner.os }}-moon-node@${{ matrix.node-version }}-
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.62.0
toolchain: 1.63.0
profile: minimal
- uses: moonrepo/tool-version-action@v1
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- uses: actions-rs/toolchain@v1
name: Setup toolchain
with:
toolchain: 1.62.0
toolchain: 1.63.0
profile: minimal
components: rustfmt
- uses: actions-rs/cargo@v1
Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:
- uses: actions-rs/toolchain@v1
name: Setup toolchain
with:
toolchain: 1.62.0
toolchain: 1.63.0
profile: minimal
components: clippy
- uses: actions-rs/cargo@v1
Expand Down Expand Up @@ -91,7 +91,7 @@ jobs:
- uses: actions-rs/toolchain@v1
name: Setup toolchain
with:
toolchain: 1.62.0
toolchain: 1.63.0
profile: minimal
components: llvm-tools-preview
- uses: actions-rs/cargo@v1
Expand Down
6 changes: 3 additions & 3 deletions crates/cache/src/items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ impl<T: DeserializeOwned + Serialize> CacheItem<T> {
}
}

#[derive(Debug, Default, Deserialize, PartialEq, Serialize)]
#[derive(Debug, Default, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct RunTargetState {
pub exit_code: i32,
Expand All @@ -99,7 +99,7 @@ pub struct RunTargetState {
pub target: String,
}

#[derive(Debug, Default, Deserialize, PartialEq, Serialize)]
#[derive(Debug, Default, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct ProjectsState {
#[serde(default)]
Expand All @@ -109,7 +109,7 @@ pub struct ProjectsState {
pub projects: HashMap<String, String>,
}

#[derive(Debug, Default, Deserialize, PartialEq, Serialize)]
#[derive(Debug, Default, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct WorkspaceState {
#[serde(default)]
Expand Down
4 changes: 3 additions & 1 deletion crates/cli/src/enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ pub enum LogLevel {
Trace,
}

#[derive(ValueEnum, Clone, Copy, Debug, Deserialize, Display, Default, PartialEq, Serialize)]
#[derive(
ValueEnum, Clone, Copy, Debug, Deserialize, Display, Default, Eq, PartialEq, Serialize,
)]
#[serde(rename_all = "lowercase")]
pub enum TouchedStatus {
Added,
Expand Down
4 changes: 2 additions & 2 deletions crates/config/src/project/dep.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use validator::Validate;

#[derive(Clone, Debug, Default, Deserialize, JsonSchema, PartialEq, Serialize)]
#[derive(Clone, Debug, Default, Deserialize, Eq, JsonSchema, PartialEq, Serialize)]
#[serde(rename_all = "lowercase")]
pub enum DependencyScope {
Development,
Expand All @@ -11,7 +11,7 @@ pub enum DependencyScope {
Production,
}

#[derive(Clone, Debug, Default, Deserialize, JsonSchema, PartialEq, Serialize, Validate)]
#[derive(Clone, Debug, Default, Deserialize, Eq, JsonSchema, PartialEq, Serialize, Validate)]
#[schemars(default)]
pub struct DependencyConfig {
pub id: String,
Expand Down
2 changes: 1 addition & 1 deletion crates/config/src/project/global.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ fn validate_tasks(map: &BTreeMap<String, TaskConfig>) -> Result<(), ValidationEr
}

/// Docs: https://moonrepo.dev/docs/config/global-project
#[derive(Debug, Default, Deserialize, JsonSchema, PartialEq, Serialize, Validate)]
#[derive(Debug, Default, Deserialize, Eq, JsonSchema, PartialEq, Serialize, Validate)]
#[serde(rename_all = "camelCase")]
pub struct GlobalProjectConfig {
#[validate(custom = "validate_extends")]
Expand Down
14 changes: 7 additions & 7 deletions crates/config/src/project/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ fn validate_channel(value: &str) -> Result<(), ValidationError> {
Ok(())
}

#[derive(Clone, Debug, Default, Deserialize, Display, JsonSchema, PartialEq, Serialize)]
#[derive(Clone, Debug, Default, Deserialize, Display, Eq, JsonSchema, PartialEq, Serialize)]
#[serde(rename_all = "lowercase")]
pub enum ProjectLanguage {
#[strum(serialize = "bash")]
Expand All @@ -81,7 +81,7 @@ pub enum ProjectLanguage {
Unknown,
}

#[derive(Clone, Debug, Default, Deserialize, Display, JsonSchema, PartialEq, Serialize)]
#[derive(Clone, Debug, Default, Deserialize, Display, Eq, JsonSchema, PartialEq, Serialize)]
#[serde(rename_all = "lowercase")]
pub enum ProjectType {
#[strum(serialize = "application")]
Expand All @@ -98,7 +98,7 @@ pub enum ProjectType {
Unknown,
}

#[derive(Clone, Debug, Deserialize, JsonSchema, PartialEq, Serialize, Validate)]
#[derive(Clone, Debug, Deserialize, Eq, JsonSchema, PartialEq, Serialize, Validate)]
pub struct ProjectMetadataConfig {
pub name: String,

Expand All @@ -112,7 +112,7 @@ pub struct ProjectMetadataConfig {
pub channel: String,
}

#[derive(Clone, Debug, Default, Deserialize, JsonSchema, PartialEq, Serialize, Validate)]
#[derive(Clone, Debug, Default, Deserialize, Eq, JsonSchema, PartialEq, Serialize, Validate)]
#[schemars(default)]
#[serde(default)]
pub struct ProjectWorkspaceInheritedTasksConfig {
Expand All @@ -126,7 +126,7 @@ pub struct ProjectWorkspaceInheritedTasksConfig {
pub rename: Option<HashMap<TaskID, TaskID>>,
}

#[derive(Clone, Debug, Default, Deserialize, JsonSchema, PartialEq, Serialize, Validate)]
#[derive(Clone, Debug, Default, Deserialize, Eq, JsonSchema, PartialEq, Serialize, Validate)]
#[schemars(default)]
#[serde(default, rename_all = "camelCase")]
pub struct ProjectWorkspaceConfig {
Expand All @@ -135,15 +135,15 @@ pub struct ProjectWorkspaceConfig {
pub inherited_tasks: ProjectWorkspaceInheritedTasksConfig,
}

#[derive(Clone, Debug, Deserialize, JsonSchema, PartialEq, Serialize)]
#[derive(Clone, Debug, Deserialize, Eq, JsonSchema, PartialEq, Serialize)]
#[serde(untagged)]
pub enum ProjectDependsOn {
String(ProjectID),
Object(DependencyConfig),
}

/// Docs: https://moonrepo.dev/docs/config/project
#[derive(Clone, Debug, Default, Deserialize, JsonSchema, PartialEq, Serialize, Validate)]
#[derive(Clone, Debug, Default, Deserialize, Eq, JsonSchema, PartialEq, Serialize, Validate)]
#[schemars(default)]
#[serde(default, rename_all = "camelCase")]
pub struct ProjectConfig {
Expand Down
12 changes: 6 additions & 6 deletions crates/config/src/project/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ fn validate_env_file(file: &TaskOptionEnvFile) -> Result<(), ValidationError> {
Ok(())
}

#[derive(Clone, Debug, Default, Deserialize, Display, JsonSchema, PartialEq, Serialize)]
#[derive(Clone, Debug, Default, Deserialize, Display, Eq, JsonSchema, PartialEq, Serialize)]
#[serde(rename_all = "lowercase")]
pub enum PlatformType {
#[strum(serialize = "node")]
Expand All @@ -66,7 +66,7 @@ pub enum PlatformType {
Unknown,
}

#[derive(Clone, Debug, Deserialize, JsonSchema, PartialEq, Serialize)]
#[derive(Clone, Debug, Deserialize, Eq, JsonSchema, PartialEq, Serialize)]
#[serde(untagged)]
pub enum TaskOptionEnvFile {
Enabled(bool),
Expand All @@ -83,7 +83,7 @@ impl TaskOptionEnvFile {
}
}

#[derive(Clone, Debug, Default, Deserialize, JsonSchema, PartialEq, Serialize)]
#[derive(Clone, Debug, Default, Deserialize, Eq, JsonSchema, PartialEq, Serialize)]
#[serde(rename_all = "lowercase")]
pub enum TaskMergeStrategy {
#[default]
Expand All @@ -92,14 +92,14 @@ pub enum TaskMergeStrategy {
Replace,
}

#[derive(Clone, Debug, Deserialize, JsonSchema, PartialEq, Serialize)]
#[derive(Clone, Debug, Deserialize, Eq, JsonSchema, PartialEq, Serialize)]
#[serde(rename_all = "kebab-case")]
pub enum TaskOutputStyle {
OnExit,
Stream,
}

#[derive(Clone, Debug, Default, Deserialize, JsonSchema, PartialEq, Serialize, Validate)]
#[derive(Clone, Debug, Default, Deserialize, Eq, JsonSchema, PartialEq, Serialize, Validate)]
#[serde(default, rename_all = "camelCase")]
pub struct TaskOptionsConfig {
#[serde(skip_serializing_if = "Option::is_none")]
Expand Down Expand Up @@ -142,7 +142,7 @@ pub struct TaskOptionsConfig {

// We use serde(default) here because figment *does not* apply defaults
// for structs nested within collections. Primarily hash maps.
#[derive(Clone, Debug, Default, Deserialize, JsonSchema, PartialEq, Serialize, Validate)]
#[derive(Clone, Debug, Default, Deserialize, Eq, JsonSchema, PartialEq, Serialize, Validate)]
#[serde(default)]
pub struct TaskConfig {
#[serde(skip_serializing_if = "Option::is_none")]
Expand Down
4 changes: 2 additions & 2 deletions crates/config/src/workspace/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ fn validate_projects(projects: &ProjectsMap) -> Result<(), ValidationError> {
Ok(())
}

#[derive(Clone, Debug, Deserialize, JsonSchema, PartialEq, Serialize, Validate)]
#[derive(Clone, Debug, Deserialize, Eq, JsonSchema, PartialEq, Serialize, Validate)]
#[schemars(default)]
#[serde(rename_all = "camelCase")]
pub struct ActionRunnerConfig {
Expand Down Expand Up @@ -78,7 +78,7 @@ impl Default for ActionRunnerConfig {
}

/// Docs: https://moonrepo.dev/docs/config/workspace
#[derive(Clone, Debug, Default, Deserialize, JsonSchema, PartialEq, Serialize, Validate)]
#[derive(Clone, Debug, Default, Deserialize, Eq, JsonSchema, PartialEq, Serialize, Validate)]
#[schemars(default)]
#[serde(rename_all = "camelCase")]
pub struct WorkspaceConfig {
Expand Down
16 changes: 8 additions & 8 deletions crates/config/src/workspace/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ fn validate_yarn_version(value: &str) -> Result<(), ValidationError> {
validate_semver_version("node.yarn.version", value)
}

#[derive(Clone, Debug, Deserialize, JsonSchema, PartialEq, Serialize)]
#[derive(Clone, Debug, Deserialize, Eq, JsonSchema, PartialEq, Serialize)]
#[serde(rename_all = "kebab-case")]
pub enum NodeProjectAliasFormat {
NameAndScope, // @scope/name
NameOnly, // name
}

#[derive(Clone, Debug, Default, Deserialize, JsonSchema, PartialEq, Serialize)]
#[derive(Clone, Debug, Default, Deserialize, Eq, JsonSchema, PartialEq, Serialize)]
#[serde(rename_all = "kebab-case")]
pub enum NodeVersionFormat {
File, // file:..
Expand Down Expand Up @@ -80,7 +80,7 @@ impl NodeVersionFormat {
}
}

#[derive(Clone, Debug, Default, Deserialize, JsonSchema, PartialEq, Serialize)]
#[derive(Clone, Debug, Default, Deserialize, Eq, JsonSchema, PartialEq, Serialize)]
#[serde(rename_all = "lowercase")]
pub enum NodePackageManager {
#[default]
Expand All @@ -89,7 +89,7 @@ pub enum NodePackageManager {
Yarn,
}

#[derive(Clone, Debug, Deserialize, JsonSchema, PartialEq, Serialize)]
#[derive(Clone, Debug, Deserialize, Eq, JsonSchema, PartialEq, Serialize)]
#[serde(rename_all = "lowercase")]
pub enum NodeVersionManager {
Nodenv,
Expand All @@ -105,7 +105,7 @@ impl NodeVersionManager {
}
}

#[derive(Clone, Debug, Deserialize, JsonSchema, PartialEq, Serialize, Validate)]
#[derive(Clone, Debug, Deserialize, Eq, JsonSchema, PartialEq, Serialize, Validate)]
#[schemars(default)]
pub struct NpmConfig {
#[validate(custom = "validate_npm_version")]
Expand All @@ -120,7 +120,7 @@ impl Default for NpmConfig {
}
}

#[derive(Clone, Debug, Deserialize, JsonSchema, PartialEq, Serialize, Validate)]
#[derive(Clone, Debug, Deserialize, Eq, JsonSchema, PartialEq, Serialize, Validate)]
pub struct PnpmConfig {
#[validate(custom = "validate_pnpm_version")]
pub version: String,
Expand All @@ -134,7 +134,7 @@ impl Default for PnpmConfig {
}
}

#[derive(Clone, Debug, Deserialize, JsonSchema, PartialEq, Serialize, Validate)]
#[derive(Clone, Debug, Deserialize, Eq, JsonSchema, PartialEq, Serialize, Validate)]
pub struct YarnConfig {
#[validate(custom = "validate_yarn_version")]
pub version: String,
Expand All @@ -148,7 +148,7 @@ impl Default for YarnConfig {
}
}

#[derive(Clone, Debug, Deserialize, JsonSchema, PartialEq, Serialize, Validate)]
#[derive(Clone, Debug, Deserialize, Eq, JsonSchema, PartialEq, Serialize, Validate)]
#[schemars(default)]
#[serde(rename_all = "camelCase")]
pub struct NodeConfig {
Expand Down
2 changes: 1 addition & 1 deletion crates/config/src/workspace/typescript.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use validator::Validate;

#[derive(Clone, Debug, Deserialize, JsonSchema, PartialEq, Serialize, Validate)]
#[derive(Clone, Debug, Deserialize, Eq, JsonSchema, PartialEq, Serialize, Validate)]
#[schemars(default)]
#[serde(rename_all = "camelCase")]
pub struct TypeScriptConfig {
Expand Down
4 changes: 2 additions & 2 deletions crates/config/src/workspace/vcs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use validator::Validate;

#[derive(Clone, Debug, Default, Deserialize, JsonSchema, PartialEq, Serialize)]
#[derive(Clone, Debug, Default, Deserialize, Eq, JsonSchema, PartialEq, Serialize)]
#[serde(rename_all = "lowercase")]
pub enum VcsManager {
#[default]
Git,
Svn,
}

#[derive(Clone, Debug, Deserialize, JsonSchema, PartialEq, Serialize, Validate)]
#[derive(Clone, Debug, Deserialize, Eq, JsonSchema, PartialEq, Serialize, Validate)]
#[schemars(default)]
#[serde(rename_all = "camelCase")]
pub struct VcsConfig {
Expand Down
Loading

0 comments on commit a857630

Please sign in to comment.