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

refactor: start_docker() #1410

Merged
merged 5 commits into from
Jul 20, 2022
Merged

refactor: start_docker() #1410

merged 5 commits into from
Jul 20, 2022

Conversation

AkshayAwate
Copy link
Contributor

@AkshayAwate AkshayAwate commented Jul 16, 2022

Running a command and then checking its exit status with $? against 0 is redundant.
More info can be found: https://www.shellcheck.net/wiki/SC2181
If this is good to go, then we can refactor other functions code too.
Thanks

Copy link
Member

@prashant-shahi prashant-shahi left a comment

Choose a reason for hiding this comment

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

Thanks for the pull request!

Can you also address similar ones in line number 268, 272 and 290?

[Line 268:](javascript:setPosition(268, 15))
        if (( $EUID != 0 )); then
              ^-- [SC2004](https://www.shellcheck.net/wiki/SC2004) (style): $/${} is unnecessary on arithmetic variables.
 
[Line 272:](javascript:setPosition(272, 19))
            if [[ $? -ne 0 ]] && ! $sudo_cmd -v; then
                  ^-- [SC2181](https://www.shellcheck.net/wiki/SC2181) (style): Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?.
 
[Line 290:](javascript:setPosition(290, 7))
if (( $EUID != 0 )); then
      ^-- [SC2004](https://www.shellcheck.net/wiki/SC2004) (style): $/${} is unnecessary on arithmetic variables.
 
[Line 307:](javascript:setPosition(307, 7))
if [[ $? -ne 0 ]]; then
      ^-- [SC2181](https://www.shellcheck.net/wiki/SC2181) (style): Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?.

deploy/install.sh Show resolved Hide resolved
@AkshayAwate
Copy link
Contributor Author

@prashant-shahi since there is no arithmatic calculation involved using $EUID, we can ignore refactoring
L268 and L290

@sonarcloud
Copy link

sonarcloud bot commented Jul 20, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@prashant-shahi
Copy link
Member

@AkshayAwate shellcheck was asking to use EUID instead of $EUID for the arithmetic operation.
But anyways, we can address that and other best practices later.

@prashant-shahi prashant-shahi merged commit acb3721 into SigNoz:develop Jul 20, 2022
@welcome
Copy link

welcome bot commented Jul 20, 2022

Congrats on merging your first pull request!
minion-party
We here at SigNoz are proud of you! 🥳

@makeavish makeavish added this to the v0.10.1 milestone Aug 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants