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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5e28af528222741e3d805ba162643f4e7b739c56
4
- data.tar.gz: 34d5a5bb5c16637c96939d59be91ca3378d9b2fc
3
+ metadata.gz: 2ae3eb67d4cb24b1c4506ebac139782d2ff137de
4
+ data.tar.gz: 0ce29c9d94aa3af0c87be1110da41e495a7af7d3
5
5
  SHA512:
6
- metadata.gz: f0849ed6312b44cae65c95a67e9b48375aa1de23379f3370849182209b8740cb630cf02888cc97ea74fcbe05877a6c3869ed8afdc84f2ff3de586d41a20d4adc
7
- data.tar.gz: be6ce3d5f7a7132ca37bfc61d7979be2cefd5e88b11c7e566d71ac9219c1b51002a7d0ee46b89c6a54aeb9dd150aa585a8ccd9d7d3d26d3bc2fbb7e9c2524b92
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
@@ -1,11 +1,15 @@
1
1
  language: ruby
2
2
 
3
3
  rvm:
4
- - 1.9.3
5
- - 2.0.0
4
+ - 2.0
6
5
  - 2.1
7
6
  - 2.2
8
7
  - jruby
9
8
  - rbx-2
9
+ matrix:
10
+ allow_failures:
11
+ - rvm: rbx-2
12
+ - rvm: jruby
13
+ fast_finish: true
10
14
 
11
15
  script: "bundle exec rake"
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 2.0.0 / 2015-11-11
2
+
3
+ * [CHANGE] Drop support for ruby 1.9
4
+
1
5
  # 1.4.0 / 2015-03-14
2
6
 
3
7
  * [FEATURE] New report in JSON format. Available by using the new CLI option `-f`
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/OrOflfj.png)
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/0ETNrX7.png)
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/5CpPt9v.png)
23
+ ![RubyCritic smells index screenshot](http://i.imgur.com/PvkFEe3.png)
24
24
 
25
- 4. Finally, when analysing code like the following:
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/tCgZX9I.png)
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/KLVrhMm.png)
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
- | `-m/--mode-ci` | Uses CI mode (faster, but only analyses last commit) |
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. This is my first gem, so just commenting on an issue and giving some insight into how something should work will be appreciated. No contribution is too small.
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 [@glitchdout][10] or [@Whitesmithco][11].
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/glitchdout
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(paths)
11
- config = OpenStruct.new(:options => OpenStruct.new(:config_file => DEFAULT_CONFIG_FILE))
12
- ::Reek::Configuration::AppConfiguration.initialize_with(config)
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
@@ -18,7 +18,7 @@ module Rubycritic
18
18
  private
19
19
 
20
20
  def add_smells_to(analysed_module)
21
- Reek.new(analysed_module.path).smells.each do |smell|
21
+ Reek.new(analysed_module.pathname).smells.each do |smell|
22
22
  analysed_module.smells << create_smell(smell)
23
23
  end
24
24
  end
@@ -1,4 +1,5 @@
1
1
  require "json"
2
+ require "rubycritic/version"
2
3
 
3
4
  module Rubycritic
4
5
  module Generator
@@ -1,3 +1,3 @@
1
1
  module Rubycritic
2
- VERSION = "1.4.0"
2
+ VERSION = "2.0.0"
3
3
  end
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 = ">= 1.9.3"
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.4.0"
25
- spec.add_runtime_dependency "flog", "4.2.1"
26
- spec.add_runtime_dependency "reek", "1.6.5"
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.28.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
- @analysed_module = AnalysedModuleDouble.new(:path => "test/samples/reek/smelly.rb", :smells => [])
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
- @analysed_module = AnalysedModuleDouble.new(:path => "test/samples/reek/not_smelly.rb", :smells => [])
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: 1.4.0
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-03-14 00:00:00.000000000 Z
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.4.0
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.4.0
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.1
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.1
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: 1.6.5
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: 1.6.5
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.28.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.28.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: 1.9.3
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.1
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