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

[implant] Add code quality tools #34

Open
wants to merge 23 commits into
base: release/1.11.0
Choose a base branch
from
Open

Conversation

savacano28
Copy link

@savacano28 savacano28 commented Dec 23, 2024

Proposed changes

Chunck 1:

Add the next code quality tools to CI for Linux & Mac :
→ Cllippy: lint checks https://github.com/rust-lang/rust-clippy
→ Rustfmt: format code
→ Cargo Audit: check security dependencies (Linux, Mac)
→ test

After apply these tools some files were updated.

Related issues

  • Obas #1982
  • #1981

Checklist

  • I consider the submitted work as finished
  • I tested the code for its functionality
  • I wrote test cases for the relevant uses case
  • I added/update the relevant documentation (either on github or on notion)
  • Where necessary I refactored code to improve the overall quality

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...

@savacano28 savacano28 marked this pull request as ready for review December 24, 2024 15:55
}

pub fn handle_execution_command(
semantic: &str,
api: &Client,
inject_id: String,
command: &String,
executor: &String,
executor: &str,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: Why changing executor type and not command as well ?

@@ -124,7 +124,7 @@ pub fn handle_payload(inject_id: String, api: &Client, contract_payload: &Inject
let executor = contract_payload.payload_cleanup_executor.clone().unwrap();
let _ = handle_execution_command(
"cleanup execution",
&api,
api,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand correctly, $api allows you to use the $api variable directly without making a copy.
Wouldn't it be more efficient to keep $api everywhere?

@@ -106,6 +106,17 @@ jobs:
- run: sudo apt-get -y install curl musl-tools
- run: curl https://sh.rustup.rs -sSf | sh -s -- -y
- run: . "$HOME/.cargo/env"; rustup target add x86_64-unknown-linux-musl
# Install quality tools
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: Can we add the fact of putting the build in error if we have warnings during compilation?

.expect("Failed to create TLS config with crypto provider");
let config = ClientConfig::builder_with_provider(arc_crypto_provider)
.with_safe_default_protocol_versions()
.unwrap()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: Can we keep the expect here ?

.expect("Failed to create TLS config with crypto provider")

let config = ClientConfig::builder_with_provider(arc_crypto_provider)
.with_safe_default_protocol_versions()
.unwrap()
.with_platform_verifier()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: Why adding this line ?

@RomuDeuxfois
Copy link
Member

Can we take advantage of your PR to push this renovation through?
#33

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants