Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-2909

Incorporate linting and static verification with rubocop

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PUP 4.0.0
    • Component/s: None
    • Labels:
    • Environment:

      All

    • Template:
    • Story Points:
      3
    • Sprint:
      2014-07-23
    • Release Notes:
      Not Needed

      Description

      [Rubocop](https://github.com/bbatsov/rubocop) is a static verification and linting tool for ruby. It tries to look for violations of [ruby-style-guide](https://github.com/bbatsov/ruby-style-guide), which is useful to avoid common programming errors that can be caught before runtime. The particular restrictions enabled are called `Cops` in Rubocop parlance.

      We have a [thread in puppet-dev mailing list](https://groups.google.com/forum/#!topic/puppet-dev/Yy6i2AGw66o) which will be used to evolve consensus regarding the particular cops to be enabled for puppet codebase. As of now, we have consensus on enabling these cops immediately

      ```
      Lint/UnreachableCode
      Lint/ConditionPosition
      Lint/UselessComparison
      Lint/LiteralInterpolation
      Lint/ElseLayout
      ```
      and `Style/AndOr` to be taken up later.

      Our plan involves incorporating rubocop as a puppet rake task `rake rubocop`, and invoke it as a job from travisCI during pull requests, and also run the task using Jenkins.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                rahul Rahul Gopinath
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Zendesk Support