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

Suppress Devskim false alerts #3

Merged
merged 1 commit into from
Nov 29, 2022
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
2 changes: 1 addition & 1 deletion dtdl-parser/src/model_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ mod model_parser_tests {

let getproperty_value_result = get_property_result.unwrap().get("@value");
assert!(getproperty_value_result.is_some());
assert!(getproperty_value_result.unwrap() == "http://[::1]:40010");
assert!(getproperty_value_result.unwrap() == "http://[::1]:40010"); // Devskim: ignore DS137138

assert!(model.len() == 8);
}
Expand Down
6 changes: 3 additions & 3 deletions provider/src/provider_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ mod provider_impl_tests {

let first_id = String::from("one-id");
let second_id = String::from("two-id");
let first_uri = String::from("http://first.com:9000");
let second_uri = String::from("http://second.com:9000");
let third_uri = String::from("http://third.com:9000");
let first_uri = String::from("http://first.com:9000"); // Devskim: ignore DS137138
let second_uri = String::from("http://second.com:9000"); // Devskim: ignore DS137138
let third_uri = String::from("http://third.com:9000"); // Devskim: ignore DS137138

let first_request =
tonic::Request::new(SubscribeRequest { id: first_id.clone(), uri: first_uri.clone() });
Expand Down
4 changes: 2 additions & 2 deletions samples/simple/consumer/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {

// Obtain the DTDL for the ambient air temmpterature.
info!("Sending a find_by_id request to the Digital Twin Service for the DTDL for ambient air temperature.");
let mut client = DigitalTwinClient::connect("http://[::1]:50010").await?;
let mut client = DigitalTwinClient::connect("http://[::1]:50010").await?; // Devskim: ignore DS137138
let request = tonic::Request::new(FindByIdRequest {
id: String::from(AMBIENT_AIR_TEMPERATURE_PROPERTY_ID),
});
Expand Down Expand Up @@ -91,7 +91,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut client = ProviderClient::connect(uri).await?;
let request = tonic::Request::new(SubscribeRequest {
id: String::from(AMBIENT_AIR_TEMPERATURE_PROPERTY_ID),
uri: String::from("http://[::1]:60010"),
uri: String::from("http://[::1]:60010"), // Devskim: ignore DS137138
});
let _response = client.subscribe(request).await?;
info!("Subscribe request completed.");
Expand Down
2 changes: 1 addition & 1 deletion samples/simple/provider/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
Server::builder().add_service(ProviderServer::new(provider_impl)).serve(addr);

info!("Registering the Provider's DTDL with the Digital Twin Service.");
let mut client = DigitalTwinClient::connect("http://[::1]:50010").await?;
let mut client = DigitalTwinClient::connect("http://[::1]:50010").await?; // Devskim: ignore DS137138
let request = tonic::Request::new(RegisterRequest { dtdl });
let _response = client.register(request).await?;
info!("The Provider's DTDL has been registered.");
Expand Down