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

.coafile: Add ShellCheckBear #2385

Merged
merged 2 commits into from
Apr 10, 2018
Merged

Conversation

sangamcse
Copy link
Member

@sangamcse sangamcse commented Mar 28, 2018

This add a bash section and bash
as default shell in .coafile.

Closes #2320

For short term contributors: we understand that getting your commits well
defined like we require is a hard task and takes some learning. If you
look to help without wanting to contribute long term there's no need
for you to learn this. Just drop us a message and we'll take care of brushing
up your stuff for merge!

Checklist

  • I read the commit guidelines and I've followed
    them.
  • I ran coala over my code locally. (All commits have to pass
    individually.
    It is not sufficient to have "fixup commits" on your PR,
    our bot will still report the issues for the previous commit.) You will
    likely receive a lot of bot comments and build failures if coala does not
    pass on every single commit!

After you submit your pull request, DO NOT click the 'Update Branch' button.
When asked for a rebase, consult coala.io/rebase
instead.

Please consider helping us by reviewing other peoples pull requests as well:

The more you review, the more your score will grow at coala.io and we will
review your PRs faster!

@gitmate-bot
Copy link
Collaborator

Comment on 77d9829, file .ci/env_variables.sh, line 1.

Declare and assign separately to avoid masking return values. [SC2155]

Origin: ShellCheckBear, Section: bash.

@gitmate-bot
Copy link
Collaborator

Comment on 77d9829, file .ci/env_variables.sh, line 2.

Declare and assign separately to avoid masking return values. [SC2155]

Origin: ShellCheckBear, Section: bash.

@gitmate-bot
Copy link
Collaborator

Comment on 77d9829, file .ci/env_variables.sh, line 3.

Declare and assign separately to avoid masking return values. [SC2155]

Origin: ShellCheckBear, Section: bash.

@gitmate-bot
Copy link
Collaborator

Comment on 64e11fb, file .ci/env_variables.sh, line 1.

Declare and assign separately to avoid masking return values. [SC2155]

Origin: ShellCheckBear, Section: bash.

@gitmate-bot
Copy link
Collaborator

Comment on 64e11fb, file .ci/env_variables.sh, line 2.

Declare and assign separately to avoid masking return values. [SC2155]

Origin: ShellCheckBear, Section: bash.

@gitmate-bot
Copy link
Collaborator

Comment on 64e11fb, file .ci/env_variables.sh, line 3.

Declare and assign separately to avoid masking return values. [SC2155]

Origin: ShellCheckBear, Section: bash.

@gitmate-bot
Copy link
Collaborator

Comment on 77d9829, file .ci/env_variables.sh, line 1.

Declare and assign separately to avoid masking return values. [SC2155]

Origin: ShellCheckBear, Section: bash.

@gitmate-bot
Copy link
Collaborator

Comment on 77d9829, file .ci/env_variables.sh, line 2.

Declare and assign separately to avoid masking return values. [SC2155]

Origin: ShellCheckBear, Section: bash.

@gitmate-bot
Copy link
Collaborator

Comment on 77d9829, file .ci/env_variables.sh, line 3.

Declare and assign separately to avoid masking return values. [SC2155]

Origin: ShellCheckBear, Section: bash.

@gitmate-bot
Copy link
Collaborator

Comment on 77d9829, file .ci/env_variables.sh, line 1.

Declare and assign separately to avoid masking return values. [SC2155]

Origin: ShellCheckBear, Section: bash.

@gitmate-bot
Copy link
Collaborator

Comment on 77d9829, file .ci/env_variables.sh, line 2.

Declare and assign separately to avoid masking return values. [SC2155]

Origin: ShellCheckBear, Section: bash.

@gitmate-bot
Copy link
Collaborator

Comment on 77d9829, file .ci/env_variables.sh, line 3.

Declare and assign separately to avoid masking return values. [SC2155]

Origin: ShellCheckBear, Section: bash.

@sangamcse sangamcse force-pushed the shellcheckbear branch 2 times, most recently from 86c10d7 to 105d991 Compare March 28, 2018 14:43
Copy link
Member

@refeed refeed left a comment

Choose a reason for hiding this comment

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

Mostly LGTM 👍 , one thing again, could you squash your commits into one commit (.coafile: Add ShellCheckBear), since they're still in the same topic

@sangamcse
Copy link
Member Author

@refeed, Thank you for your review. As you can see the commit body's comment, I have mentioned that the file inside .ci was modified as per shfmt and not using shellcheck. So I have splitted these commit.
Also, check coala/coala#5243 commits

@refeed
Copy link
Member

refeed commented Mar 30, 2018

Ahh, makes sense, I thought shfmt was a tool that is related with shellcheck.

@@ -3,4 +3,3 @@
"version": "{{version}}",
"dependencies": {{dependencies | jsonify(indent=4, sort_keys=True)}}
}

Copy link
Member

Choose a reason for hiding this comment

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

I think this is not related with #2320 ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes. Should I make it newcomer issue or keep it here? I found this while I was modifying shell scripts in .ci.

Copy link
Member

Choose a reason for hiding this comment

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

yup, I think a newcomer issue would be fine for this

Copy link
Member Author

Choose a reason for hiding this comment

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

Done #2388

@sangamcse sangamcse force-pushed the shellcheckbear branch 4 times, most recently from d54a65b to 05c375e Compare March 30, 2018 10:09
Copy link
Member

@refeed refeed left a comment

Choose a reason for hiding this comment

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

Btw, where is the line that does:

Also, add `shellcheck` as prerequisite
for CircleCI.

@sangamcse
Copy link
Member Author

@refeed, good catch 😉. I just removed that line before your comment.

Copy link
Member

@refeed refeed left a comment

Choose a reason for hiding this comment

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

LGTM

.ci/deps.r.sh Outdated
@@ -2,7 +2,7 @@ set -e
set -x

# R commands
echo '.libPaths( c( "'"$R_LIB_USER"'", .libPaths()) )' >> .Rprofile
echo 'options(repos=structure(c(CRAN="http://cran.rstudio.com")))' >> .Rprofile
echo '.libPaths( c( "'"$R_LIB_USER"'", .libPaths()) )' >>.Rprofile
Copy link
Member

Choose a reason for hiding this comment

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

hmm. I find this style very jarring.
can it be disabled?
@yukiisbored your opinion on this rule?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't have much knowledge about these R stuff.

Copy link
Member

Choose a reason for hiding this comment

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

It isnt R.

All >> foo are being forced to be >>foo

Copy link
Member

Choose a reason for hiding this comment

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

Can you find a rule to ignore these changes?

Copy link
Member Author

@sangamcse sangamcse Apr 10, 2018

Choose a reason for hiding this comment

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

Understood.
Actually, this was not done by shellcheck but by the shfmt.

can it be disabled?

I can revert these changes. 😃

.ci/deps.pip.sh Outdated
@@ -5,13 +5,13 @@ TERM=dumb

# Choose the python versions to install deps for
case $CIRCLE_NODE_INDEX in
0) dep_versions=( "3.4.3" "3.5.1" ) ;;
Copy link
Member

Choose a reason for hiding this comment

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

all this circle stuff will go with the circle-ci patch.
but that might take a while.

Copy link
Member Author

Choose a reason for hiding this comment

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

Should I keep this file or remove all changes?

Copy link
Member

Choose a reason for hiding this comment

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

Put it on the ignore list.

@@ -8,6 +8,6 @@ source ../rultor_secrets.sh

Copy link
Member

Choose a reason for hiding this comment

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

this script will be removed as part of see #2410
should happen quickly

Copy link
Member Author

@sangamcse sangamcse Apr 8, 2018

Choose a reason for hiding this comment

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

Should I remove any changes from this file? @jayvdb

Copy link
Member

Choose a reason for hiding this comment

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

That is fixed; rebase and this file disappears

@sangamcse sangamcse force-pushed the shellcheckbear branch 5 times, most recently from d0c74f8 to 0b67368 Compare April 10, 2018 09:06
.ci/deps.apt.sh Outdated
@@ -19,7 +19,7 @@ case $CIRCLE_BUILD_IMAGE in
# Use xenial, needed to replace outdated julia provided by Circle CI
ADD_APT_UBUNTU_RELEASE=xenial
# Work around lack of systemd on trusty, which xenial's lxc-common expects
echo '#!/bin/sh' | sudo tee /usr/bin/systemd-detect-virt > /dev/null
echo '#!/bin/sh' | sudo tee /usr/bin/systemd-detect-virt >/dev/null
Copy link
Member

Choose a reason for hiding this comment

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

cant we ignore the rule that causes this?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes.

This add a `bash` section and `bash`
as default `shell` in `.coafile`.

Closes coala#2320
Give coala's shell scripts a standard.
Modify .sh files using `shfmt -i 2 -ci`
from https://github.com/mvdan/sh#shfmt.
This changes shell scripts according to
Google's guide.

Closes coala#2320
@jayvdb
Copy link
Member

jayvdb commented Apr 10, 2018

ack 7634540 b650a4b

@jayvdb
Copy link
Member

jayvdb commented Apr 10, 2018

@gitmate-bot ff

@gitmate-bot
Copy link
Collaborator

Hey! I'm GitMate.io! This pull request is being fastforwarded automatically. Please DO NOT push while fastforward is in progress or your changes would be lost permanently ⚠️

@gitmate-bot
Copy link
Collaborator

Automated fastforward with GitMate.io was successful! 🎉

@gitmate-bot gitmate-bot merged commit b650a4b into coala:master Apr 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

Add ShellCheckBear to .coafile
4 participants