rubycritic 2.1.0 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +1 -0
- data/CHANGELOG.md +4 -0
- data/CONTRIBUTING.md +2 -2
- data/README.md +19 -0
- data/lib/rubycritic/analysers/helpers/reek.rb +0 -9
- data/lib/rubycritic/version.rb +1 -1
- data/test/lib/rubycritic/analysers/smells/reek_test.rb +5 -15
- data/test/samples/reek/smelly.rb +7 -0
- metadata +3 -4
- data/lib/rubycritic/analysers/helpers/config.reek +0 -26
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1bbd53ca30b1e2cae94b44246ca2df4f1ef200bb
|
4
|
+
data.tar.gz: 584e3a45c1c3ae04c261366b706699c5087effea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a452882ed7dc3cb9bd8ab6817650a4f475ea06cc465ff7c9d9290495578be1ad76c04eb31cd66155813a88d14ad28c44c43280f2bcef7d0a5a521d8e8abd97c
|
7
|
+
data.tar.gz: 2b2f54e2f3f40363bdd9f628e0f0fa0ff742dde3ad217aa69f0d25e2bb0424bc3a8119a37937e42c49fbf197604c5e4ae54e1c8d0fb3459f90662461165f9609
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/CONTRIBUTING.md
CHANGED
@@ -32,8 +32,8 @@ Each commit should do one thing and one thing only. For example, all whitespace
|
|
32
32
|
|
33
33
|
9. [Create a Pull Request] and send it to be merged with the master branch.
|
34
34
|
|
35
|
-
10. After your code is reviewed, [hide the sausage making].
|
36
|
-
For a more in-depth look at interactive rebasing, be sure to check [how to rewrite history].
|
35
|
+
10. After your code is reviewed, [hide the sausage making]. We follow the "one commit per pull request" [principle](http://ndlib.github.io/practices/one-commit-per-pull-request/) since this allows for a clean git history, easy handling of features and convenient rollbacks when things go wrong. Or in one sentence: You can have as many commits as you want in your pull request, but after the final review and before the merge you need to squash all of those in one single commit.
|
36
|
+
For a more in-depth look at interactive rebasing, be sure to check [how to rewrite history] as well.
|
37
37
|
|
38
38
|
Improving the Documentation
|
39
39
|
---------------------------
|
data/README.md
CHANGED
@@ -100,6 +100,14 @@ $ rubycritic --help
|
|
100
100
|
| `--deduplicate-symlinks` | De-duplicate symlinks based on their final target |
|
101
101
|
| `--suppress-ratings` | Suppress letter ratings |
|
102
102
|
|
103
|
+
Analyzer Configuration
|
104
|
+
-------------------------
|
105
|
+
|
106
|
+
* `Reek`: `RubyCritic` just uses `Reek`'s default [configuration loading mechanism](https://github.com/troessner/reek#configuration-file).
|
107
|
+
|
108
|
+
This section is work in progress at the moment and is missing the other analyzers that RubyCritic supports.
|
109
|
+
You can expect this to be updated soon.
|
110
|
+
|
103
111
|
Alternative Usage Methods
|
104
112
|
-------------------------
|
105
113
|
|
@@ -131,6 +139,17 @@ Similarly, Pull Requests that improve the look and feel of the gem, that tweak t
|
|
131
139
|
|
132
140
|
See RubyCritic's [contributing guidelines](CONTRIBUTING.md) about how to proceed.
|
133
141
|
|
142
|
+
Contributors / Core Team
|
143
|
+
---------------
|
144
|
+
|
145
|
+
`RubyCritics` initial author was [Guilherme Simões](https://github.com/guilhermesimoes).
|
146
|
+
|
147
|
+
The current core team consists of:
|
148
|
+
|
149
|
+
* [Nuno Silva](https://github.com/Onumis)
|
150
|
+
* [Lucas Mazza](https://github.com/lucasmazza)
|
151
|
+
* [Timo Rößner](https://github.com/troessner)
|
152
|
+
|
134
153
|
Credits
|
135
154
|
-------
|
136
155
|
|
@@ -1,15 +1,6 @@
|
|
1
1
|
require "reek"
|
2
|
-
require "reek/configuration/app_configuration"
|
3
|
-
require "ostruct"
|
4
2
|
|
5
3
|
module Rubycritic
|
6
|
-
|
7
4
|
class Reek < ::Reek::Examiner
|
8
|
-
DEFAULT_CONFIG_FILE = File.expand_path("../config.reek", __FILE__)
|
9
|
-
|
10
|
-
def initialize(pathname)
|
11
|
-
config = ::Reek::Configuration::AppConfiguration.from_path(DEFAULT_CONFIG_FILE)
|
12
|
-
super(pathname, [], :configuration => config)
|
13
|
-
end
|
14
5
|
end
|
15
6
|
end
|
data/lib/rubycritic/version.rb
CHANGED
@@ -11,25 +11,15 @@ describe Rubycritic::Analyser::ReekSmells do
|
|
11
11
|
end
|
12
12
|
|
13
13
|
it "detects its smells" do
|
14
|
-
@analysed_module.smells.length.must_equal
|
14
|
+
@analysed_module.smells.length.must_equal 2
|
15
15
|
end
|
16
16
|
|
17
17
|
it "creates smells with messages" do
|
18
|
-
|
19
|
-
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
context "when analysing a file with smells ignored in config.reek" do
|
24
|
-
before do
|
25
|
-
pathname = Pathname.new("test/samples/reek/not_smelly.rb")
|
26
|
-
@analysed_module = AnalysedModuleDouble.new(:pathname => pathname, :smells => [])
|
27
|
-
analysed_modules = [@analysed_module]
|
28
|
-
Rubycritic::Analyser::ReekSmells.new(analysed_modules).run
|
29
|
-
end
|
18
|
+
first_smell = @analysed_module.smells.first
|
19
|
+
first_smell.message.must_equal "has no descriptive comment"
|
30
20
|
|
31
|
-
|
32
|
-
|
21
|
+
last_smell = @analysed_module.smells.last
|
22
|
+
last_smell.message.must_equal "has boolean parameter 'reek'"
|
33
23
|
end
|
34
24
|
end
|
35
25
|
end
|
data/test/samples/reek/smelly.rb
CHANGED
@@ -3,3 +3,10 @@ class Theon
|
|
3
3
|
reek
|
4
4
|
end
|
5
5
|
end
|
6
|
+
|
7
|
+
# Reek should report
|
8
|
+
# [1]:Theon has no descriptive comment (IrresponsibleModule)
|
9
|
+
# [2]:Theon#reeks? has boolean parameter 'reek' (BooleanParameter)
|
10
|
+
# This comment is below the module because otherwise Reek will interpret this
|
11
|
+
# as a comment describing the module which would thus prevent
|
12
|
+
# IrresponsibleModule from being reported.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubycritic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Guilherme Simoes
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: virtus
|
@@ -180,7 +180,6 @@ files:
|
|
180
180
|
- lib/rubycritic/analysers/churn.rb
|
181
181
|
- lib/rubycritic/analysers/complexity.rb
|
182
182
|
- lib/rubycritic/analysers/helpers/ast_node.rb
|
183
|
-
- lib/rubycritic/analysers/helpers/config.reek
|
184
183
|
- lib/rubycritic/analysers/helpers/flay.rb
|
185
184
|
- lib/rubycritic/analysers/helpers/flog.rb
|
186
185
|
- lib/rubycritic/analysers/helpers/methods_counter.rb
|
@@ -301,7 +300,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
301
300
|
version: '0'
|
302
301
|
requirements: []
|
303
302
|
rubyforge_project:
|
304
|
-
rubygems_version: 2.4.
|
303
|
+
rubygems_version: 2.4.6
|
305
304
|
signing_key:
|
306
305
|
specification_version: 4
|
307
306
|
summary: RubyCritic is a Ruby code quality reporter
|
@@ -1,26 +0,0 @@
|
|
1
|
-
---
|
2
|
-
Attribute:
|
3
|
-
enabled: false
|
4
|
-
DuplicateMethodCall:
|
5
|
-
max_calls: 2
|
6
|
-
IrresponsibleModule:
|
7
|
-
enabled: false
|
8
|
-
NestedIterators:
|
9
|
-
max_allowed_nesting: 2
|
10
|
-
TooManyStatements:
|
11
|
-
enabled: false
|
12
|
-
UncommunicativeMethodName:
|
13
|
-
reject:
|
14
|
-
- !ruby/regexp /^[a-z]$/
|
15
|
-
- !ruby/regexp /[0-9]$/
|
16
|
-
UncommunicativeParameterName:
|
17
|
-
reject:
|
18
|
-
- !ruby/regexp /^.$/
|
19
|
-
- !ruby/regexp /[0-9]$/
|
20
|
-
- !ruby/regexp /^_/
|
21
|
-
UncommunicativeVariableName:
|
22
|
-
reject:
|
23
|
-
- !ruby/regexp /^.$/
|
24
|
-
- !ruby/regexp /[0-9]$/
|
25
|
-
UtilityFunction:
|
26
|
-
enabled: false
|