advertilecop 0.0.4 → 0.1.1

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: 72af57af68f49ecb05194e55d9003e57287c1296
4
- data.tar.gz: 2816671a523d2e662d94bacfdb87b2d3e9baf056
3
+ metadata.gz: 369260db496e622486e960e4b5b30b607855e473
4
+ data.tar.gz: '095809039e7e4f7e0da68973870d82a66bba32e2'
5
5
  SHA512:
6
- metadata.gz: 510b30700816890a80067e90fc7767df1aafd54460b39dbac7111bf327cdcbac430d164fa94a08b2aa8e0da708672d7ac4be606a4e4ecd7b78c2c422139858ea
7
- data.tar.gz: 46a006988c89aacf623f42f93152e3008377736f5d4ec7613e6c56c09fc807ccfc1cc05d0e65a2989afbb316152a028f520e26182b32170ab264cac6a2a0f023
6
+ metadata.gz: 81fe3568c0ee0089c83c0fa775e1ecd8715af4bd37e09f6e21e65e1f4676d0deb0fa8cfad753516f5951cb5ef2412684342393594aad6d3966e54f615b663803
7
+ data.tar.gz: 6dfbc8f00093471dadd3750bf1f6255a0c57cddd3a9700d4b9ecc4709837a0ab2b3c82b6328ac7e6dfc49536f7646970212582a9488c76bbc1cb63f4eda05ffd
data/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  AdvertileCop uses [RuboCop](https://github.com/bbatsov/rubocop) to enforce Advertile Mobiles's style guidelines.
6
6
 
7
- "What are the guidelines?", I hear you bellow. Well, [check out our commented settings file](https://github.com/Advertile/advertilecop/blob/master/lib/advertilecop.yml) for more information.
7
+ "What are the guidelines?", I hear you below. Well, [check out our commented settings file](https://gitlab.com/Advertile/advertilecop/blob/master/lib/advertilecop.yml) for more information.
8
8
 
9
9
  ## Installation
10
10
 
@@ -58,6 +58,15 @@ $ advertilecop -a
58
58
  ```
59
59
  Anything that can be auto corrected will be, this will save you a lot of time!
60
60
 
61
+ ## Overriding tests
62
+
63
+ It is possible to override specific Rubocop settings by having a _.rubocop.yml_ in the project root. When present, advertilecop uses this file instead of _advertilecop.yml_. This file can, however, the settings of _advertilecop.yml_ by having the following lines:
64
+
65
+ ```yml
66
+ inherit_gem:
67
+ advertilecop: ./lib/advertilecop.yml
68
+ ```
69
+
61
70
  ## Configuring / Contributing
62
71
 
63
72
  1. You can't configure this, thats the point.
data/lib/advertilecop.rb CHANGED
@@ -6,6 +6,8 @@ module RuboCop
6
6
  class ConfigLoader
7
7
  class << self
8
8
  def configuration_file_for(_target_dir)
9
+ root_config = File.join(Dir.pwd, ".rubocop.yml")
10
+ return root_config if File.exist?(root_config)
9
11
  File.join(File.realpath(File.dirname(__FILE__)), "advertilecop.yml")
10
12
  end
11
13
  end
data/lib/advertilecop.yml CHANGED
@@ -9,10 +9,22 @@ AllCops:
9
9
  Documentation:
10
10
  Enabled: false
11
11
 
12
+ Layout/MultilineMethodCallIndentation:
13
+ Enabled: true
14
+ EnforcedStyle: indented
15
+
12
16
  Lint/AssignmentInCondition:
13
17
  AllowSafeAssignment: true
14
18
  Enabled: true
15
19
 
20
+ Metrics/ClassLength:
21
+ Max: 200
22
+
23
+ Metrics/AbcSize:
24
+ # The ABC size is a calculated magnitude, so this number can be an Integer or
25
+ # a Float.
26
+ Max: 30
27
+
16
28
  Metrics/BlockLength:
17
29
  CountComments: false # count full line comments?
18
30
  Max: 25
@@ -20,7 +32,7 @@ Metrics/BlockLength:
20
32
  Exclude:
21
33
  - 'Rakefile'
22
34
  - '**/*.rake'
23
- - '**/spec/**/*.rb'
35
+ - 'spec/**/*.rb'
24
36
 
25
37
  Metrics/LineLength:
26
38
  Max: 120
@@ -29,7 +41,7 @@ Metrics/LineLength:
29
41
 
30
42
  Metrics/MethodLength:
31
43
  CountComments: false # count full line comments?
32
- Max: 10
44
+ Max: 25
33
45
  Enabled: true
34
46
 
35
47
  Metrics/ModuleLength:
@@ -80,7 +92,3 @@ Style/StringLiterals:
80
92
  Style/TrailingCommaInLiteral:
81
93
  EnforcedStyleForMultiline: comma
82
94
  Enabled: true
83
-
84
- Style/VariableNumber:
85
- EnforcedStyle: snake_case
86
- Enabled: true
@@ -4,7 +4,7 @@ require "rubocop/rake_task"
4
4
 
5
5
  module AdvertileCop
6
6
  class RakeTask < RuboCop::RakeTask
7
- def initialize(*args, &task_block) # rubocop:disable Metrics/AbcSize
7
+ def initialize(name, *args, &task_block) # rubocop:disable Metrics/AbcSize
8
8
  setup_ivars(args)
9
9
 
10
10
  desc "Run RuboCop" unless ::Rake.application.last_description
@@ -12,7 +12,7 @@ module AdvertileCop
12
12
  task(name, *args) do |_, task_args|
13
13
  RakeFileUtils.send(:verbose, verbose) do
14
14
  yield(*[self, task_args].slice(0, task_block.arity)) if block_given?
15
- run_main_task(verbose)
15
+ run_cli(verbose, full_options)
16
16
  end
17
17
  end
18
18
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module AdvertileCop
4
- VERSION = "0.0.4".freeze
4
+ VERSION = "0.1.1".freeze
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: advertilecop
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mika Hel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-31 00:00:00.000000000 Z
11
+ date: 2018-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
@@ -91,7 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
91
91
  version: '0'
92
92
  requirements: []
93
93
  rubyforge_project:
94
- rubygems_version: 2.6.11
94
+ rubygems_version: 2.5.2
95
95
  signing_key:
96
96
  specification_version: 4
97
97
  summary: Like RuboCop only for Advertile