rubycritic 1.4.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +5 -0
- data/.travis.yml +6 -2
- data/CHANGELOG.md +4 -0
- data/CONTRIBUTING.md +2 -1
- data/README.md +29 -11
- data/lib/rubycritic/analysers/helpers/reek.rb +3 -5
- data/lib/rubycritic/analysers/smells/reek.rb +1 -1
- data/lib/rubycritic/generators/json/simple.rb +1 -0
- data/lib/rubycritic/version.rb +1 -1
- data/rubycritic.gemspec +5 -5
- data/test/lib/rubycritic/analysers/smells/reek_test.rb +4 -2
- metadata +12 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2ae3eb67d4cb24b1c4506ebac139782d2ff137de
|
4
|
+
data.tar.gz: 0ce29c9d94aa3af0c87be1110da41e495a7af7d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4644d18c524776d9db1df62c7102a60130f7116de64cb82a92cfb37d65f9019ddd8bb7cc872cc38e1bf4f72eb8d0e48667994cb0b52386b4caa876b081a514c2
|
7
|
+
data.tar.gz: 4cc7824f83745b032e1bf4f60b69d36bafa423a040880186776d859cfe0833b567d3f1b968d0d83bfdeb85ef18716985f495d784fc63e3f241631949757df59b
|
data/.rubocop.yml
CHANGED
@@ -535,6 +535,11 @@ Style/WordArray:
|
|
535
535
|
|
536
536
|
##################### Metrics ##################################
|
537
537
|
|
538
|
+
Metrics/AbcSize:
|
539
|
+
# The ABC size is a calculated magnitude, so this number can be a Fixnum or
|
540
|
+
# a Float.
|
541
|
+
Max: 22
|
542
|
+
|
538
543
|
Metrics/BlockNesting:
|
539
544
|
Max: 2
|
540
545
|
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/CONTRIBUTING.md
CHANGED
@@ -20,7 +20,7 @@ If you want to squash a bug or add a new feature, please:
|
|
20
20
|
|
21
21
|
4. Run the tests with the `rake` command. Make sure that they are still passing.
|
22
22
|
|
23
|
-
5. Stage partial-file changesets (`git -p`).
|
23
|
+
5. [Stage partial-file changesets] \(`git add -p`).
|
24
24
|
|
25
25
|
6. Commit your changes (`git commit`).
|
26
26
|
Make exactly as many commits as you need.
|
@@ -61,6 +61,7 @@ If you are experiencing unexpected behavior and, after having read the documenta
|
|
61
61
|
The more information you provide, the easier it will be to track down the issue and fix it.
|
62
62
|
If you have never written a bug report before, or if you want to brush up on your bug reporting skills, read Simon Tatham's essay [How to Report Bugs Effectively].
|
63
63
|
|
64
|
+
[Stage partial-file changesets]: http://nuclearsquid.com/writings/git-add/
|
64
65
|
[descriptive commit messages]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
|
65
66
|
[Create a pull request]: https://help.github.com/articles/creating-a-pull-request
|
66
67
|
[hide the sausage making]: http://sethrobertson.github.io/GitBestPractices/#sausage
|
data/README.md
CHANGED
@@ -12,17 +12,17 @@ This gem provides features such as:
|
|
12
12
|
|
13
13
|
1. An overview of your project:
|
14
14
|
|
15
|
-
![RubyCritic overview screenshot](http://i.imgur.com/
|
15
|
+
![RubyCritic overview screenshot](http://i.imgur.com/oiE5O3X.png)
|
16
16
|
|
17
17
|
2. An index of the project files with their respective number of smells:
|
18
18
|
|
19
|
-
![RubyCritic code index screenshot](http://i.imgur.com/
|
19
|
+
![RubyCritic code index screenshot](http://i.imgur.com/a0GCn48.png)
|
20
20
|
|
21
21
|
3. An index of the smells detected:
|
22
22
|
|
23
|
-
![RubyCritic smells index screenshot](http://i.imgur.com/
|
23
|
+
![RubyCritic smells index screenshot](http://i.imgur.com/PvkFEe3.png)
|
24
24
|
|
25
|
-
4.
|
25
|
+
4. When analysing code like the following:
|
26
26
|
|
27
27
|
```ruby
|
28
28
|
class Dirty
|
@@ -36,11 +36,17 @@ This gem provides features such as:
|
|
36
36
|
|
37
37
|
It basically turns something like this:
|
38
38
|
|
39
|
-
![Reek output screenshot](http://i.imgur.com/
|
39
|
+
![Reek output screenshot](http://i.imgur.com/5G2zPIC.png)
|
40
40
|
|
41
41
|
Into something like this:
|
42
42
|
|
43
|
-
![RubyCritic file code screenshot](http://i.imgur.com/
|
43
|
+
![RubyCritic file code screenshot](http://i.imgur.com/RNzXewk.png)
|
44
|
+
|
45
|
+
5. It uses your source control system (only Git is supported for now) to
|
46
|
+
compare your currently uncommitted changes with your last commit.
|
47
|
+
|
48
|
+
**Warning**: If your code is not as you expect it to be after running
|
49
|
+
RubyCritic, please check your source control system stash.
|
44
50
|
|
45
51
|
Getting Started
|
46
52
|
---------------
|
@@ -90,7 +96,7 @@ $ rubycritic --help
|
|
90
96
|
|--------------------------|-------------------------------------------------------|
|
91
97
|
| `-v/--version` | Displays the current version and exits |
|
92
98
|
| `-p/--path` | Sets the output directory (tmp/rubycritic by default) |
|
93
|
-
|
|
99
|
+
| `--mode-ci` | Uses CI mode (faster, but only analyses last commit) |
|
94
100
|
| `--deduplicate-symlinks` | De-duplicate symlinks based on their final target |
|
95
101
|
| `--suppress-ratings` | Suppress letter ratings |
|
96
102
|
|
@@ -101,6 +107,19 @@ If you're fond of Guard you might like [guard-rubycritic][4]. It automatically a
|
|
101
107
|
|
102
108
|
For continuous integration, you can give [Jenkins CI][5] a spin. With it, you can [easily build your own (poor-man's) Code Climate][6]!
|
103
109
|
|
110
|
+
Compatibility
|
111
|
+
---------------
|
112
|
+
|
113
|
+
RubyCritic is supporting:
|
114
|
+
|
115
|
+
* 2.0
|
116
|
+
* 2.1
|
117
|
+
* 2.2
|
118
|
+
|
119
|
+
Note that we do not support Ruby 1.9 anymore.
|
120
|
+
|
121
|
+
If you're still on ruby 1.9 you'll have to use the last version of RubyCritic that supports it, which would be [1.4.0](https://github.com/whitesmith/rubycritic/tree/v1.4.0).
|
122
|
+
|
104
123
|
Improving RubyCritic
|
105
124
|
--------------------
|
106
125
|
|
@@ -108,7 +127,7 @@ RubyCritic doesn't have to remain a second choice to other code quality analysis
|
|
108
127
|
|
109
128
|
Arguably, the [better_errors gem][7] only got popular after receiving a [(pretty awesome) Pull Request][8] that changed its page design.
|
110
129
|
|
111
|
-
Similarly, Pull Requests that improve the look and feel of the gem, that tweak the calculation of ratings or that fix existing issues will be most welcome.
|
130
|
+
Similarly, Pull Requests that improve the look and feel of the gem, that tweak the calculation of ratings or that fix existing issues will be most welcome. Just commenting on an issue and giving some insight into how something should work will be appreciated. No contribution is too small.
|
112
131
|
|
113
132
|
See RubyCritic's [contributing guidelines](CONTRIBUTING.md) about how to proceed.
|
114
133
|
|
@@ -117,7 +136,7 @@ Credits
|
|
117
136
|
|
118
137
|
![Whitesmith](http://i.imgur.com/Si2l3kd.png)
|
119
138
|
|
120
|
-
RubyCritic is maintained and funded by [Whitesmith][9]. Tweet your questions or suggestions to [@
|
139
|
+
RubyCritic is maintained and funded by [Whitesmith][9]. Tweet your questions or suggestions to [@Whitesmithco][10].
|
121
140
|
|
122
141
|
[1]: https://github.com/troessner/reek
|
123
142
|
[2]: https://github.com/seattlerb/flay
|
@@ -128,5 +147,4 @@ RubyCritic is maintained and funded by [Whitesmith][9]. Tweet your questions or
|
|
128
147
|
[7]: https://github.com/charliesome/better_errors
|
129
148
|
[8]: https://github.com/charliesome/better_errors/pull/22
|
130
149
|
[9]: http://www.whitesmith.co/
|
131
|
-
[10]: https://twitter.com/
|
132
|
-
[11]: https://twitter.com/Whitesmithco
|
150
|
+
[10]: https://twitter.com/Whitesmithco
|
@@ -7,11 +7,9 @@ module Rubycritic
|
|
7
7
|
class Reek < ::Reek::Examiner
|
8
8
|
DEFAULT_CONFIG_FILE = File.expand_path("../config.reek", __FILE__)
|
9
9
|
|
10
|
-
def initialize(
|
11
|
-
config =
|
12
|
-
|
13
|
-
super(Array(paths))
|
10
|
+
def initialize(pathname)
|
11
|
+
config = ::Reek::Configuration::AppConfiguration.from_path(DEFAULT_CONFIG_FILE)
|
12
|
+
super(pathname, [], :configuration => config)
|
14
13
|
end
|
15
14
|
end
|
16
|
-
|
17
15
|
end
|
data/lib/rubycritic/version.rb
CHANGED
data/rubycritic.gemspec
CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
|
|
13
13
|
spec.summary = "RubyCritic is a Ruby code quality reporter"
|
14
14
|
spec.homepage = "https://github.com/whitesmith/rubycritic"
|
15
15
|
spec.license = "MIT"
|
16
|
-
spec.required_ruby_version = ">=
|
16
|
+
spec.required_ruby_version = ">= 2.0.0"
|
17
17
|
|
18
18
|
spec.files = `git ls-files`.split("\n")
|
19
19
|
spec.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
|
@@ -21,14 +21,14 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.require_path = "lib"
|
22
22
|
|
23
23
|
spec.add_runtime_dependency "virtus", "~> 1.0"
|
24
|
-
spec.add_runtime_dependency "flay", "2.
|
25
|
-
spec.add_runtime_dependency "flog", "4.2
|
26
|
-
spec.add_runtime_dependency "reek", "
|
24
|
+
spec.add_runtime_dependency "flay", "2.6.1"
|
25
|
+
spec.add_runtime_dependency "flog", "4.3.2"
|
26
|
+
spec.add_runtime_dependency "reek", "3.6.0"
|
27
27
|
spec.add_runtime_dependency "parser", ">= 2.2.0", "< 3.0"
|
28
28
|
|
29
29
|
spec.add_development_dependency "bundler", "~> 1.3"
|
30
30
|
spec.add_development_dependency "rake"
|
31
31
|
spec.add_development_dependency "minitest", "~> 5.3"
|
32
32
|
spec.add_development_dependency "mocha", "~> 1.0"
|
33
|
-
spec.add_development_dependency "rubocop", "0.
|
33
|
+
spec.add_development_dependency "rubocop", "0.29.0"
|
34
34
|
end
|
@@ -4,7 +4,8 @@ require "rubycritic/analysers/smells/reek"
|
|
4
4
|
describe Rubycritic::Analyser::ReekSmells do
|
5
5
|
context "when analysing a smelly file" do
|
6
6
|
before do
|
7
|
-
|
7
|
+
pathname = Pathname.new("test/samples/reek/smelly.rb")
|
8
|
+
@analysed_module = AnalysedModuleDouble.new(:pathname => pathname, :smells => [])
|
8
9
|
analysed_modules = [@analysed_module]
|
9
10
|
Rubycritic::Analyser::ReekSmells.new(analysed_modules).run
|
10
11
|
end
|
@@ -21,7 +22,8 @@ describe Rubycritic::Analyser::ReekSmells do
|
|
21
22
|
|
22
23
|
context "when analysing a file with smells ignored in config.reek" do
|
23
24
|
before do
|
24
|
-
|
25
|
+
pathname = Pathname.new("test/samples/reek/not_smelly.rb")
|
26
|
+
@analysed_module = AnalysedModuleDouble.new(:pathname => pathname, :smells => [])
|
25
27
|
analysed_modules = [@analysed_module]
|
26
28
|
Rubycritic::Analyser::ReekSmells.new(analysed_modules).run
|
27
29
|
end
|
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:
|
4
|
+
version: 2.0.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
|
+
date: 2015-11-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: virtus
|
@@ -30,42 +30,42 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 2.
|
33
|
+
version: 2.6.1
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 2.
|
40
|
+
version: 2.6.1
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: flog
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - '='
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 4.2
|
47
|
+
version: 4.3.2
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - '='
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 4.2
|
54
|
+
version: 4.3.2
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: reek
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - '='
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: 3.6.0
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - '='
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
68
|
+
version: 3.6.0
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: parser
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -148,14 +148,14 @@ dependencies:
|
|
148
148
|
requirements:
|
149
149
|
- - '='
|
150
150
|
- !ruby/object:Gem::Version
|
151
|
-
version: 0.
|
151
|
+
version: 0.29.0
|
152
152
|
type: :development
|
153
153
|
prerelease: false
|
154
154
|
version_requirements: !ruby/object:Gem::Requirement
|
155
155
|
requirements:
|
156
156
|
- - '='
|
157
157
|
- !ruby/object:Gem::Version
|
158
|
-
version: 0.
|
158
|
+
version: 0.29.0
|
159
159
|
description: RubyCritic is a tool that wraps around various static analysis gems to
|
160
160
|
provide a quality report of your Ruby code.
|
161
161
|
email:
|
@@ -293,7 +293,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
293
293
|
requirements:
|
294
294
|
- - ">="
|
295
295
|
- !ruby/object:Gem::Version
|
296
|
-
version:
|
296
|
+
version: 2.0.0
|
297
297
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
298
298
|
requirements:
|
299
299
|
- - ">="
|
@@ -301,7 +301,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
301
301
|
version: '0'
|
302
302
|
requirements: []
|
303
303
|
rubyforge_project:
|
304
|
-
rubygems_version: 2.4.
|
304
|
+
rubygems_version: 2.4.5
|
305
305
|
signing_key:
|
306
306
|
specification_version: 4
|
307
307
|
summary: RubyCritic is a Ruby code quality reporter
|