- how to set it up for a repository
bundle exec rubocop --auto-gen-config
- how to make rubocop run after every patch set submission to gerrit
- how to solve problems from the autogenerated todo file one by one
bundle exec rubocop --auto-gen-config
| Unknown Object (Diffusion Commit) |
| Status | Subtype | Assigned | Task | ||
|---|---|---|---|---|---|
| Resolved | hashar | T1368 Document RuboCop workflow | |||
| Resolved | zeljkofilipin | T1361 Repositories with Ruby code should be documented and appropriate Jenkins jobs should be running | |||
| Resolved | zeljkofilipin | T102020 Setup rubocop for operations/puppet ruby code lints | |||
| Resolved | zeljkofilipin | T110019 Move RuboCop job from experimental pipeline to the usual pipelines for operations/puppet | |||
| Resolved | zeljkofilipin | T117993 Add Rakefile to repositories with Ruby code | |||
| Resolved | zeljkofilipin | T114860 Move Bundler Jenkins jobs to Nodepool instances | |||
| Resolved | dduvall | T104024 Define a CI entry point for Ruby code | |||
| Duplicate | zeljkofilipin | T114262 Delete ruby2.0lint job and only run bundle-rubocop job for repositories with Ruby code | |||
| Resolved | hashar | T112670 also clone submodules in operations/puppet jobs | |||
| Resolved | zeljkofilipin | T112091 Run RuboCop for QuickSurveys | |||
| Resolved | zeljkofilipin | T112097 Ruby syntax check and RuboCop for Gather | |||
| Resolved | zeljkofilipin | T112272 Run ruby2.0lint instead of ruby1.9.3lint |
I wrote a blog post recently with generic RuboCop workflow, not specific to Wikimedia.
I still have to document Wikimedia specific things.
Looks like all that needs to be done if you want to run ruby syntax check and rubocop for a mediawiki extension is to run extension-rubylint Zuul template.
Code:
# Template for MediaWiki extensions. # Run Ruby linter. - name: extension-rubylint check: - 'ruby1.9.3lint' test: - 'bundle-rubocop' - 'ruby1.9.3lint' gate-and-submit: - 'bundle-rubocop' - 'ruby1.9.3lint'
- name: mediawiki/extensions/ArticleFeedbackv5 template: - name: extension-checks - name: extension-rubylint
Feel free to add a step by step tutorial for ruby repositories, we have a few already: https://www.mediawiki.org/wiki/Continuous_integration/Tutorials . Though it should cover more than rubocop, see parent task T1361.
If the repository is not a mediawiki extension, then add only ruby1.9.3lint job to check , and both bundle-rubocop and ruby1.9.3lint jobs to test and gate-and-submit.
- name: mediawiki/ruby/api check: - ruby1.9.3lint test: - bundle-rubocop - ruby1.9.3lint - bundle-rspec - mediawiki-ruby-api-gembuild - bundle-yard gate-and-submit: - bundle-rubocop - ruby1.9.3lint - bundle-rspec - mediawiki-ruby-api-gembuild - bundle-yard postmerge: - mediawiki-ruby-api-gembuild - mediawiki-ruby-api-bundle-yard-publish
Not working on this. I plan to continue with this later, but feel free to take the task.
We have moved to use rake as an entry point. It is described on https://www.mediawiki.org/wiki/Continuous_integration/Entry_points#Ruby which seems to be good enough as a documentation for now. Ie one would run rake rubocop.