Skip to content
This repository has been archived by the owner on Apr 7, 2020. It is now read-only.

Commit

Permalink
init project
Browse files Browse the repository at this point in the history
  • Loading branch information
sinsoku committed Sep 26, 2016
0 parents commit 727bb83
Show file tree
Hide file tree
Showing 14 changed files with 292 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .gitignore
@@ -0,0 +1,9 @@
/.bundle/
/.yardoc
/Gemfile.lock
/_yardoc/
/coverage/
/doc/
/pkg/
/spec/reports/
/tmp/
2 changes: 2 additions & 0 deletions .rubocop.yml
@@ -0,0 +1,2 @@
inherit_gem:
forkwell_cop: 'config/default.yml'
1 change: 1 addition & 0 deletions .ruby-version
@@ -0,0 +1 @@
2.3.1
5 changes: 5 additions & 0 deletions .travis.yml
@@ -0,0 +1,5 @@
sudo: false
language: ruby
before_install: gem install bundler -v 1.13.1
notifications:
email: false
5 changes: 5 additions & 0 deletions Gemfile
@@ -0,0 +1,5 @@
# frozen_string_literal: true
source 'https://rubygems.org'

# Specify your gem's dependencies in forkwell_cop.gemspec
gemspec
21 changes: 21 additions & 0 deletions LICENSE.txt
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2016 grooves

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
38 changes: 38 additions & 0 deletions README.md
@@ -0,0 +1,38 @@
# ForkwellCop

[![Gem Version](https://badge.fury.io/rb/forkwell_cop.svg)](https://badge.fury.io/rb/forkwell_cop)
[![Build Status](https://travis-ci.org/grooves/forkwell_cop.svg?branch=master)](https://travis-ci.org/grooves/forkwell_cop)

RuboCop configration in [Forkwell](https://forkwell.com). Inspired by [onkcop](https://github.com/onk/onkcop).

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'forkwell_cop', require: false
```

## Usage

Put this into your `.rubocop.yml`:

```yml
inherit_gem:
forkwell_cop:
- 'config/default.yml'
```

And then execute:

```
bundle exec rubocop
```

## Contributing

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

## License

The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
6 changes: 6 additions & 0 deletions Rakefile
@@ -0,0 +1,6 @@
# frozen_string_literal: true
require 'bundler/gem_tasks'
require 'rubocop/rake_task'

RuboCop::RakeTask.new
task default: :rubocop
3 changes: 3 additions & 0 deletions config/default.yml
@@ -0,0 +1,3 @@
inherit_from:
- enabled.yml
- todo.yml
80 changes: 80 additions & 0 deletions config/enabled.yml
@@ -0,0 +1,80 @@
AllCops:
# .ruby-version の指定と合わせるため指定しない
# TargetRubyVersion: ~
DisplayCopNames: true
DisplayStyleGuide: true
ExtraDetails: true
Exclude:
- 'tmp/**/*'
- 'db/schema.rb'
- 'node_modules/**/*'

Rails:
Enabled: true

Metrics/ClassLength:
CountComments: false
Max: 450

Metrics/ModuleLength:
CountComments: false
Max: 130

Metrics/LineLength:
Max: 250
AllowHeredoc: true
AllowURI: true
URISchemes:
- http
- https

Metrics/MethodLength:
Max: 130

Metrics/AbcSize:
Max: 50

# # 宗教の違いを許容する
# def some_method_with_parameters param1, param2
# # body omitted
# end
#
# def some_method_with_parameters(param1, param2)
# # body omitted
# end
Style/MethodDefParentheses:
Enabled: false

Style/AccessorMethodName:
Exclude:
# # action_args を使うため
# before_action :set_user
#
# def set_user(id)
# @user = User.find(id)
# end
- '*_controller.rb'

# 日本語コメントを許容する
Style/AsciiComments:
Enabled: false

Style/LambdaCall:
Exclude:
# # jbuilder の README の通りに書いても検出されるため
# json.(@message, :created_at, :updated_at)
- '**/*.jbuilder'

# # consistent
# hash = {
# key: :value
# }
# and_in_a_method_call({
# no: :difference
# })
Style/IndentHash:
EnforcedStyle: consistent

# ドキュメントの無い public クラスを許容する
Style/Documentation:
Enabled: false
91 changes: 91 additions & 0 deletions config/todo.yml
@@ -0,0 +1,91 @@
# These are the cops before discussion in Forkwell team.

Lint/EnsureReturn:
Enabled: true

Lint/Eval:
Enabled: true

Metrics/CyclomaticComplexity:
Max: 12

Metrics/ParameterLists:
Max: 8

Metrics/PerceivedComplexity:
Max: 10

Rails/Date:
Enabled: true

Rails/FindEach:
Enabled: true

Rails/NotNullColumn:
Enabled: true

Rails/Output:
Enabled: true

Rails/OutputSafety:
Enabled: true

Rails/Validation:
Enabled: false

Style/Alias:
Enabled: true

Style/AlignHash:
Enabled: true

Style/AlignParameters:
Enabled: true

Style/BlockDelimiters:
Enabled: false

Style/BracesAroundHashParameters:
Enabled: false

Style/CaseEquality:
Enabled: true

Style/ClassAndModuleChildren:
Enabled: false

Style/ClassCheck:
Enabled: true

Style/ClassVars:
Enabled: true

Style/DoubleNegation:
Enabled: true

Style/FormatString:
Enabled: true

Style/HashSyntax:
Enabled: false

Style/IfInsideElse:
Enabled: true

Style/MultilineMethodCallIndentation:
Enabled: false

Style/PredicateName:
Enabled: true

Style/SafeNavigation:
Enabled: true

Style/SingleLineBlockParams:
Enabled: true

Style/VariableNumber:
Enabled: false

Style/GuardClause:
Enabled: false
22 changes: 22 additions & 0 deletions forkwell_cop.gemspec
@@ -0,0 +1,22 @@
# coding: utf-8
# frozen_string_literal: true
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'forkwell_cop/version'

Gem::Specification.new do |spec|
spec.name = 'forkwell_cop'
spec.version = ForkwellCop::VERSION
spec.authors = ['grooves']

spec.summary = 'RuboCop configration in Forkwell'
spec.description = 'RuboCop configration in Forkwell'
spec.homepage = 'https://github.com/grooves/forkwell_cop'

spec.files = `git ls-files -z`.split("\x0")
spec.require_paths = ['lib']

spec.add_dependency 'rubocop', '~> 0.43.0'
spec.add_development_dependency 'bundler', '~> 1.13'
spec.add_development_dependency 'rake', '~> 10.0'
end
5 changes: 5 additions & 0 deletions lib/forkwell_cop.rb
@@ -0,0 +1,5 @@
# frozen_string_literal: true
require 'forkwell_cop/version'

module ForkwellCop
end
4 changes: 4 additions & 0 deletions lib/forkwell_cop/version.rb
@@ -0,0 +1,4 @@
# frozen_string_literal: true
module ForkwellCop
VERSION = '0.1.0'
end

0 comments on commit 727bb83

Please sign in to comment.