rubocop_default_config 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2b3922c637c83afaa961403fc3fc82e2131354aa
4
- data.tar.gz: e04dcb50b2f5c0082d47d3efd989cb5b90aa1c0b
3
+ metadata.gz: a3692cbd73d421269b7f5d218436fde736f38007
4
+ data.tar.gz: f878a4a157e338faa9cff4f5693cbfd3d21c8962
5
5
  SHA512:
6
- metadata.gz: 05bea9a941b10cf7a83f0dee918bd124168b7629131b693183d2123d31ce523ac411c195c2b6718d412b589e2cf3a276c653c1e9532e735d3d4dbf5fc7f9beca
7
- data.tar.gz: 01c82fda81e939789194dc37efc4b2103ac7bf5e04154496f9e071cad134dff17ffc35ec3a8a84aa70650705ca659b304b717dbcb5f450b28093280a3105937d
6
+ metadata.gz: 37434cf589bbc57a9e8aecfef0e82291445a1149922a91d4a262b07f448c132e8d3bfc5c9f762b4c2a02b352fbed3505d35edf7d0fbaee1971f7daafc5399809
7
+ data.tar.gz: d804d333bfd305b0b224f65fc7cf673e6c4f9cba819d461fa8e8e99f254161683d6f4c940678b5bb8ace47ca9741f8d76f26d9bcf30e7773006d14d76bd8af01
data/README.md CHANGED
@@ -10,7 +10,9 @@ Run `rubocop-config`
10
10
 
11
11
  **Note**
12
12
 
13
- This gem will generates *.rubocop.yml* & *.rubocop_todo.yml* config automatically. So, you do not need to run `rubocop --auto-gen-config`
13
+ This gem will generates *.rubocop.yml* & *.rubocop_todo.yml* config automatically. So, you do not need to run `rubocop --auto-gen-config` .
14
+
15
+ Just run `rubocop_gen_common` if you want to generate Rubocop popular config. Then you can edit it to match your style.
14
16
 
15
17
  ## License
16
18
 
data/bin/rubocop_config CHANGED
@@ -2,4 +2,4 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  require 'rubocop_config'
5
- RubocopConfig.new.rubocop_generate_config
5
+ RubocopConfig.new.generate_to_do_list
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require 'rubocop_config'
5
+ RubocopConfig.new.generate_common_config
@@ -0,0 +1,7 @@
1
+ inherit_from: .rubocop_todo.yml
2
+ AllCops:
3
+ UseCache: false
4
+ Exclude:
5
+ - 'db/schema.rb'
6
+ - 'vendor/**/*'
7
+ - Gemfile.lock
@@ -3,13 +3,26 @@ require "yaml"
3
3
  class RubocopConfig
4
4
  # Generate popular config for RuboCop.
5
5
  # Run *rubocop_config* to generate .rubocop.yml file.
6
- def rubocop_generate_config
7
- puts "Generating rubocop config ..."
6
+
7
+ def generate_to_do_list
8
+ generate_default_config
9
+ puts "Generating rubocop todo config ..."
10
+ exec 'rubocop --auto-gen-config --exclude-limit 9999' rescue nil
11
+ end
12
+
13
+ def generate_default_config
14
+ puts 'Generating rubocop default config ...'
15
+ file_name = ".rubocop.yml"
16
+ config_file = File.expand_path File.dirname(__FILE__) + '/.rubocop_default_config.yml'
17
+ config = YAML.safe_load(ERB.new(File.read(config_file)).result)
18
+ File.open(file_name, "w") { |f| f << config.to_yaml }
19
+ end
20
+
21
+ def generate_common_config
22
+ puts "Generating rubocop common config ..."
8
23
  file_name = ".rubocop.yml"
9
24
  config_file = File.expand_path File.dirname(__FILE__) + '/.rubocop_popular_config.yml'
10
25
  config = YAML.safe_load(ERB.new(File.read(config_file)).result)
11
26
  File.open(file_name, "w") { |f| f << config.to_yaml }
12
- puts "Generating rubocop todo config ..."
13
- exec 'rubocop --auto-gen-config' rescue nil
14
27
  end
15
28
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop_default_config
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thai Huynh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-30 00:00:00.000000000 Z
11
+ date: 2017-10-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -56,11 +56,14 @@ description: A simple gem to generate default config for RuboCop
56
56
  email: qthai.huynh@gmail.com
57
57
  executables:
58
58
  - rubocop_config
59
+ - rubocop_gen_common
59
60
  extensions: []
60
61
  extra_rdoc_files: []
61
62
  files:
62
63
  - README.md
63
64
  - bin/rubocop_config
65
+ - bin/rubocop_gen_common
66
+ - lib/.rubocop_default_config.yml
64
67
  - lib/.rubocop_popular_config.yml
65
68
  - lib/rubocop_config.rb
66
69
  homepage: http://rubygems.org/gems/rubocop_default_config