Skip to content

refactor: start_docker()#1410

Merged
prashant-shahi merged 5 commits intoSigNoz:developfrom
AkshayAwate:develop
Jul 20, 2022
Merged

refactor: start_docker()#1410
prashant-shahi merged 5 commits intoSigNoz:developfrom
AkshayAwate:develop

Conversation

@AkshayAwate
Copy link
Copy Markdown
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
Copy Markdown
Contributor

@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 $?.

Comment thread deploy/install.sh
@AkshayAwate
Copy link
Copy Markdown
Contributor Author

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

@sonarqubecloud
Copy link
Copy Markdown

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
Copy Markdown
Contributor

@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
Copy Markdown

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