advertilecop 0.0.4 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +10 -1
- data/lib/advertilecop.rb +2 -0
- data/lib/advertilecop.yml +14 -6
- data/lib/advertilecop/rake_task.rb +2 -2
- data/lib/advertilecop/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 369260db496e622486e960e4b5b30b607855e473
|
4
|
+
data.tar.gz: '095809039e7e4f7e0da68973870d82a66bba32e2'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
-
- '
|
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:
|
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
|
-
|
15
|
+
run_cli(verbose, full_options)
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
data/lib/advertilecop/version.rb
CHANGED
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.
|
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:
|
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.
|
94
|
+
rubygems_version: 2.5.2
|
95
95
|
signing_key:
|
96
96
|
specification_version: 4
|
97
97
|
summary: Like RuboCop only for Advertile
|