It’s common that you want to run Rubocop on your plugin. In various plugins I’ve seen the pattern that it defines some rubocop task. However, most rake tasks are executed from the Foreman checkout itself. Standardizing this also makes it easier to run in CI. This is why I opened a PR to run Rubocop in a plugin.
The workflow is:
git clone foreman.gitand add
my_pluginas a dependency (as you normally would)
bundle exec rake plugin:rubocop[my_plugin]from the foreman checkout
It will use
.rubocop.yml from the plugin if present. You can also pass another argument to output a JUnit XML file which can be very useful in CI.
Let me know if I missed anything. If it’s merged, I’m proposing to cherry pick it to stable branches so we can update our Jenkins setup to use it.