[QA] Ruby Coding Conventions and RuboCop (was: Rubocop style checker)

S Page spage at wikimedia.org
Thu Nov 20 01:48:21 UTC 2014


Speaking of overzealous rules, The Flow rubocop job was failing on its
Gemfile:

*02:53:31* Gemfile:1:1: C: Missing space after #.*02:53:31*
#ruby=ruby-2.1.1*02:53:31* ^^^^^^^^^^^^^^^^*02:53:31* Gemfile:2:1: C:
Missing space after #.*02:53:31* #ruby-gemset=Flow*02:53:31*
^^^^^^^^^^^^^^^^^

but all our Gemfiles are written this way.

I stole the fix from CirrusSearch/.rubocop.yml :

Style/LeadingCommentSpace:
  Exclude:
    - Gemfile  # RVM doesn't recognise spaces after the #s
and now the mwext-Flow-bundle-rubocop CI job passes.

Is there a way MediaWiki extensions can share common configuration and
dev_scripts like this? Maybe extensions/shared, or
extensions/Mantle/defaults


On Fri, Oct 31, 2014 at 4:05 PM, Dan Duvall <dduvall at wikimedia.org> wrote:

> Hey all,
>
> Zeljko, Antoine, and I have been working on a first draft of the Ruby
> coding conventions for MW-related projects, and dialing in the RuboCop
> checker accordingly.[1] I encourage anyone who has a bit of Ruby knowledge
> and/or an opinion on style to contribute to the conversion.[2]
>
> As the article suggests, there are a handful of contentious rules in the
> bbatsov style guide from which the conventions are based. This first draft
> attempts to resolve those conflicts—mainly by ignoring the rules—and is
> intended to be organically revised as the discussion evolves—that kinda
> goes without saying given it's a wiki. :)
>
> Just some clarification on the RuboCop check: 1) it's non-voting for the
> time being to give maintainers a chance to customize the configuration
> according to project/team needs; and 2) it should be green to start with
> since the configuration was auto-generated and ignores everything it finds
> by default.[3]
>
> Let us know if you have any more questions about the checker. Happy
> arguing! (I mean that in all seriousness as I enjoy discussing semantics.)
>
> Cheers,
> Dan
>
> [1] https://www.mediawiki.org/wiki/Manual:Coding_conventions/Ruby
> [2] https://www.mediawiki.org/wiki/Manual_talk:Coding_conventions/Ruby
> [3] https://www.mediawiki.org/wiki/Manual:Coding_conventions/Ruby#RuboCop
>
> --
> Dan Duvall
> Automation Engineer
> Wikimedia Foundation <http://wikimediafoundation.org>
>
> _______________________________________________
> QA mailing list
> QA at lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/qa
>
>


-- 
=S Page  Features engineer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.wikimedia.org/pipermail/qa/attachments/20141119/4303379d/attachment-0001.html>


More information about the QA mailing list