Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hixonrails/rubocop-hixonrails
RuboCop configuration with the following extensions: rubocop-rails, rubocop-performance, rubocop-rspec and rubocop-rake. Easily extensible, created by Hix on Rails.
https://github.com/hixonrails/rubocop-hixonrails
hix rails rspec-styleguide rubocop rubocop-defaults rubocop-performance rubocop-rails rubocop-rspec ruby-styleguide
Last synced: about 1 month ago
JSON representation
RuboCop configuration with the following extensions: rubocop-rails, rubocop-performance, rubocop-rspec and rubocop-rake. Easily extensible, created by Hix on Rails.
- Host: GitHub
- URL: https://github.com/hixonrails/rubocop-hixonrails
- Owner: hixonrails
- License: mit
- Created: 2020-08-23T19:55:28.000Z (over 4 years ago)
- Default Branch: develop
- Last Pushed: 2020-12-12T11:30:14.000Z (about 4 years ago)
- Last Synced: 2024-11-14T10:17:25.970Z (about 2 months ago)
- Topics: hix, rails, rspec-styleguide, rubocop, rubocop-defaults, rubocop-performance, rubocop-rails, rubocop-rspec, ruby-styleguide
- Language: Ruby
- Homepage: https://hixonrails.com
- Size: 114 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# rubocop-hixonrails
[![Gem Version][gem-version-img]][gem-version]
[![Build Status][build-status-img]][build-status]RuboCop rules for [Hix on Rails][hixonrails] projects that use RSpec. Includes:
- [`rubocop`][rubocop]
- [`rubocop-performance`][rubocop-performance]
- [`rubocop-rails`][rubocop-rails]
- [`rubocop-rake`][rubocop-rake]
- [`rubocop-rspec`][rubocop-rspec]Easily extensible, created by [Hix on Rails][hixonrails].
## Installation
Add this line to your application's Gemfile:
```ruby
group :test, :development do
gem 'rubocop-hixonrails'
end
```Do notice, that you do not need to include other `rubocop-*` gems in your
Gemfile, this single one will suffice.For a Ruby library, add this to your gemspec:
```ruby
spec.add_development_dependency 'rubocop-hixonrails'
```And then run:
```bash
$ bundle install
```## Usage
Create a `.rubocop.yml` with the following directives:
```yaml
inherit_gem:
rubocop-hixonrails:
- default.yml
```Now, run:
```bash
$ bundle exec rubocop
```## Configuration
All configuration goes to [default.yml][config] file.
- [`rubocop` defaults][rubocop-defaults] & [Ruby styleguide][ruby-styleguide]
- [`rubocop-rspec` defaults][rubocop-rspec-defaults] & [RSpec styleguide][rspec-styleguide]
- [`rubocop-performance` defaults][rubocop-performance-defaults]## Enable pending cops
The gem comes with an executable:
```bash
enable_pending_cops
```To enable pending cops in the repository, simply run:
```bash
ruby bin/enable_pending_cops
```This will:
1. Override all cops marked as `Enabled: pending` in the latest core or extensions' versions installed.
2. Automatically generate the _.rubocop_todo.yml_ file, without generating `Max: n` directives.This way you can safely update the code, one by one.
## Publish to Rubygems
In order to publish new version of the gem follow the steps:
1. `git hf release start X.Y.Z`
2. bump up version in [`RubocopHixonrails::VERSION`][gem-version-path]
3. `git commit -am 'UPD version to X.Y.Z'`
4. `git hf release finish X.Y.Z`
5. `bundle update rubocop-hixonrails` in projects that use itThe `gem push` script is set up on CircleCI upon `git hf release finish`, as per
[Publishing RubyGems using Circle CI 2.0 article][publishing-rubygems-using-circleci].[hixonrails]: https://hixonrails.com
[rubocop]: https://github.com/rubocop-hq/rubocop
[rubocop-performance]: https://github.com/rubocop-hq/rubocop-performance
[rubocop-rails]: https://github.com/rubocop-hq/rubocop-rails
[rubocop-rake]: https://github.com/rubocop-hq/rubocop-rake
[rubocop-rspec]: https://github.com/rubocop-hq/rubocop-rspec
[publishing-rubygems-using-circleci]: https://medium.com/@pezholio/publishing-rubygems-using-circle-ci-2-0-1dbf06ae9942
[gem-version-path]: https://github.com/hixonrails/rubocop-hixonrails/blob/master/lib/rubocop_hixonrails.rb#L4
[config]: https://github.com/hixonrails/rubocop-hixonrails/blob/master/default.yml
[rubocop-defaults]: https://github.com/rubocop-hq/rubocop/blob/master/config/default.yml
[ruby-styleguide]: https://rubystyle.guide/
[rubocop-rspec-defaults]: https://github.com/rubocop-hq/rubocop-rspec/blob/master/config/default.yml
[rspec-styleguide]: https://rspec.rubystyle.guide/
[rubocop-performance-defaults]: https://github.com/rubocop-hq/rubocop-performance/blob/master/config/default.yml
[gem-version]: https://rubygems.org/gems/rubocop-hixonrails
[build-status]: https://circleci.com/gh/hixonrails/rubocop-hixonrails/tree/master
[gem-version-img]: https://badge.fury.io/rb/rubocop-hixonrails.svg
[build-status-img]: https://circleci.com/gh/hixonrails/rubocop-hixonrails/tree/master.svg?style=shield