Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makefile: changed Rust lint clippy to the one included in SDK #2793

Merged
merged 2 commits into from
Mar 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -439,14 +439,21 @@ rc=0
export VARIANT="${BUILDSYS_VARIANT}"

# For rust first-party source code
if ! cargo clippy \
--manifest-path ${BUILDSYS_TOOLS_DIR}/Cargo.toml \
if ! docker run --rm \
-v "$(pwd)":/tmp \
"${BUILDSYS_SDK_IMAGE}" \
cargo clippy \
--manifest-path /tmp/tools/Cargo.toml \
--locked -- -D warnings --no-deps; then
rc=1
fi

if ! cargo clippy \
--manifest-path ${BUILDSYS_SOURCES_DIR}/Cargo.toml \
if ! docker run --rm \
-v "$(pwd)":/tmp \
-e VARIANT \
"${BUILDSYS_SDK_IMAGE}" \
cargo clippy \
--manifest-path /tmp/sources/Cargo.toml \
--locked -- -D warnings --no-deps; then
rc=1
fi
Expand Down
45 changes: 32 additions & 13 deletions tools/pubsys/src/repo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -644,20 +644,23 @@ mod error {
#[snafu(display("Failed to add new target '{}' to repo: {}", path.display(), source))]
AddTarget {
path: PathBuf,
source: tough::error::Error,
#[snafu(source(from(tough::error::Error, Box::new)))]
source: Box<tough::error::Error>,
},

#[snafu(display("Failed to build target metadata from path '{}': {}", path.display(), source))]
BuildTarget {
path: PathBuf,
source: tough::schema::Error,
#[snafu(source(from(tough::schema::Error, Box::new)))]
source: Box<tough::schema::Error>,
},

#[snafu(display("Failed to copy target '{}' to '{}': {}", target.display(), path.display(), source))]
CopyTarget {
target: PathBuf,
path: PathBuf,
source: tough::error::Error,
#[snafu(source(from(tough::error::Error, Box::new)))]
source: Box<tough::error::Error>,
},

#[snafu(display("Error reading config: {}", source))]
Expand All @@ -667,7 +670,10 @@ mod error {
CreateDir { path: PathBuf, source: io::Error },

#[snafu(display("Failed to create repo editor from given repo: {}", source))]
EditorFromRepo { source: tough::error::Error },
EditorFromRepo {
#[snafu(source(from(tough::error::Error, Box::new)))]
source: Box<tough::error::Error>,
},

#[snafu(display("Failed to read '{}': {}", path.display(), source))]
File { path: PathBuf, source: io::Error },
Expand All @@ -685,7 +691,8 @@ mod error {
LinkTarget {
target: PathBuf,
path: PathBuf,
source: tough::error::Error,
#[snafu(source(from(tough::error::Error, Box::new)))]
source: Box<tough::error::Error>,
},

#[snafu(display("Failed to write Manifest to '{}': {}", path.display(), source))]
Expand All @@ -701,7 +708,10 @@ mod error {
MissingRepoUrls { repo: String },

#[snafu(display("Failed to create new repo editor: {}", source))]
NewEditor { source: tough::error::Error },
NewEditor {
#[snafu(source(from(tough::error::Error, Box::new)))]
source: Box<tough::error::Error>,
},

#[snafu(display("Repo does not have a manifest.json: {}", metadata_url))]
NoManifest { metadata_url: Url },
Expand All @@ -718,7 +728,8 @@ mod error {
#[snafu(display("Failed to read target '{}' from repo: {}", target, source))]
ReadTarget {
target: String,
source: tough::error::Error,
#[snafu(source(from(tough::error::Error, Box::new)))]
source: Box<tough::error::Error>,
},

#[snafu(display("Failed to create async runtime: {}", source))]
Expand All @@ -727,7 +738,8 @@ mod error {
#[snafu(display("Failed to parse target name from string '{}': {}", target, source))]
ParseTargetName {
target: String,
source: tough::error::Error,
#[snafu(source(from(tough::error::Error, Box::new)))]
source: Box<tough::error::Error>,
},

#[snafu(display("Repo exists at '{}' - remove it and try again", path.display()))]
Expand All @@ -743,31 +755,38 @@ mod error {
))]
RepoLoad {
metadata_base_url: Url,
source: tough::error::Error,
#[snafu(source(from(tough::error::Error, Box::new)))]
source: Box<tough::error::Error>,
},

#[snafu(display("Requested repository does not exist: '{}'", url))]
RepoNotFound { url: Url },

#[snafu(display("Failed to sign repository: {}", source))]
RepoSign { source: tough::error::Error },
RepoSign {
#[snafu(source(from(tough::error::Error, Box::new)))]
source: Box<tough::error::Error>,
},

#[snafu(display("Failed to write repository to {}: {}", path.display(), source))]
RepoWrite {
path: PathBuf,
source: tough::error::Error,
#[snafu(source(from(tough::error::Error, Box::new)))]
source: Box<tough::error::Error>,
},

#[snafu(display("Failed to set targets expiration to {}: {}", expiration, source))]
SetTargetsExpiration {
expiration: DateTime<Utc>,
source: tough::error::Error,
#[snafu(source(from(tough::error::Error, Box::new)))]
source: Box<tough::error::Error>,
},

#[snafu(display("Failed to set targets version to {}: {}", version, source))]
SetTargetsVersion {
version: u64,
source: tough::error::Error,
#[snafu(source(from(tough::error::Error, Box::new)))]
source: Box<tough::error::Error>,
},

#[snafu(display("Failed to set waves from '{}': {}", wave_policy_path.display(), source))]
Expand Down
5 changes: 4 additions & 1 deletion tools/testsys-config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,10 @@ mod error {
context(false),
display("Failed to create template for cluster name: {}", source)
)]
TemplateError { source: handlebars::TemplateError },
TemplateError {
#[snafu(source(from(handlebars::TemplateError, Box::new)))]
source: Box<handlebars::TemplateError>,
},

#[snafu(
context(false),
Expand Down
5 changes: 4 additions & 1 deletion tools/testsys/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ pub enum Error {
context(false),
display("Unable create template from yaml: {}", source)
)]
HandlebarsTemplate { source: handlebars::TemplateError },
HandlebarsTemplate {
#[snafu(source(from(handlebars::TemplateError, Box::new)))]
source: Box<handlebars::TemplateError>,
},

#[snafu(display("Unable to create map from {}: {}", what, source))]
IntoMap { what: String, source: model::Error },
Expand Down