Giter Site home page Giter Site logo

mad_rubocop's Introduction

Dependency Status

MadRubocop

Custom RuboCop yml files to modify the cops enforced by RuboCop.

Installation

Add this line to your application's Gemfile:

gem 'mad_rubocop'

And then execute:

$ bundle

Or install it yourself as:

$ gem install mad_rubocop

Add this to your project .rubocop.yml file:

inherit_gem:
  mad_rubocop: .rubocop.yml

NOTE: The Exlude setting on cops that only ignore certain files or directories cannot be set by MadRubocop.

Development

After checking out the repo, run bin/setup to install dependencies.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/mxenabled/mad_rubocop.

License

The gem is available as open source under the terms of the MIT License.

mad_rubocop's People

Contributors

eric-kovshovik avatar film42 avatar liveh2o avatar mattnichols avatar mmmries avatar mogman1 avatar newellista avatar ztoolson avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mad_rubocop's Issues

Possibly disable Style/FrozenStringLiteralComment

Looks like Style/FrozenStringLiteralComment is a cop enforced for Ruby 2.3+ to prep for Ruby 3.0. In some of the apps, that could cause a problem and require more refactoring to avoid modifying string literals and we may want to disable it for now.

@ztoolson

Upgrade MadRubocop to support RuboCop 0.37

Currently MadRuboCop supports 0.36 version of RuboCop. Here are the new cops introduces in 0.37:

0.37.0

  • #2620: New cop Style/ZeroLengthPredicate checks for object.size == 0 and variants, and suggests replacing them with an appropriate empty? predicate.
  • Add new Style/SpaceAroundKeyword cop.
  • #2745: New cop Style/MultilineHashBraceLayout checks that the closing brace in a hash literal is symmetrical with respect to the opening brace and the hash elements.
  • #2761: New cop Style/MultilineMethodDefinitionBraceLayout checks that the closing brace in a method definition is symmetrical with respect to the opening brace and the method parameters.
  • #2766: New cop Style/MultilineMethodCallBraceLayout checks that the closing brace in a method call is symmetrical with respect to the opening brace and the method arguments.

I'm not seeing any cops that we should disable, but I'll open up the discussion. What are your thoughts?

Should Depend on a specific version of rubocop

When we specify our rubocop dependency as "rubocop", "~> 0.36" that will allow bundler to install 0.36, 0.37, 0.38...

Since those minor version updates can have new cops that break a build I think it would be better for us to have each version of this gem depend on ~> 0.36.0. That will allow bundler to update micro version updates (which should just be bugfixes), but it won't allow a minor version update that would break someone's build.

This will require us to release more frequently in this gem, but I think it would be really nice to avoid confusion in the downstream projects.

RuboCop 0.38

RuboCop has released version 0.38. ๐ŸŽ‰ ๐ŸŽˆ It doesn't look like they introduced any new cops but made some improvements on exiting cops.

Summary of changes:

  • Style/UnlessElse cop can auto-correct.
  • Style/OneLineConditional cop can auto-correct.
  • Style/ZeroLengthConditional flags code like array.length < 1, 1 > array.length, and so on.
  • Lint/BlockAlignment cop can be configured to be stricter.
  • Style/Not is able to autocorrect in cases where parentheses must be added to preserve the meaning of an expression.
  • Style/Not auto-corrects comparison expressions by removing not and using the opposite comparison.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.