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

Make rubocop version configurable #10

Open
woidda opened this issue Aug 3, 2021 · 0 comments
Open

Make rubocop version configurable #10

woidda opened this issue Aug 3, 2021 · 0 comments

Comments

@woidda
Copy link

woidda commented Aug 3, 2021

It would really helpful to specify the rubocop version and the needed plugins.

In the entrypoint.sh shell script the version of the rubocop and the plugins + versions is hard coded. Would it be possible to iterate over let's say all provided environment variables and use the string they provided as version?

env:
  RUBOCOP: "0.80.1"
  RUBOCOP_RSPEC: "1.38.1"
  RUBOCOP_PERFORMANCE: "1.5.2"
  RUBOCOP_RAILS: "2.4.2"

maybe

for var in "${!RUBOCOP@}"; do
    # substitute _ with -
    org="${var//[_]/_}"
    # compose the command an convert the enviroment var key to lower case
    # build a comand similar to: gem install rubocop -v 0.80.1 
    COMMAND=$(printf 'gem install %s -v %s\n' "${org,,}" "${!var}")
    # execute the command
    eval $COMMAND
done

Should do the trick.

I think code-climate has the same issue with a not supported graphql plugin for rubocop. This would really awesome to have that supported here.

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

No branches or pull requests

1 participant