umarell 1.0.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 +7 -0
- data/LICENSE.txt +20 -0
- data/README.md +60 -0
- data/exe/umarell +11 -0
- data/lib/umarell.rb +4 -0
- data/lib/umarell/cli.rb +60 -0
- data/lib/umarell/version.rb +7 -0
- metadata +233 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 4a25c9286abc5741876a8ef140872298234a999ed8b5ff743d180b72f086d124
|
4
|
+
data.tar.gz: 5c8ea9b619ecc46dd309ef780e4decab5c973bec504ad1b8f9c9fae1a0e86ff2
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 96fbb5e8171a31ae5d7f9e7b23466ddf20800ff4dfaae0eb96704d2616ec7634282e43e2ebcc854a490b4a6d32cf52bed86a96af6106ce95735ca523742b93fb
|
7
|
+
data.tar.gz: ce8586a000314bc3e90aa7295c4e415c031b1252911b56242abcd87dc6143a70a77ef6ec77a6f23e78918c2b16270d65cf688d525937b38e804c2b762cb21b6d
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2019 Nebulab S.r.l. (https://nebulab.it)
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
# Umarell
|
2
|
+
|
3
|
+
Umarell is an all in one Ruby static code analyzer.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
```sh
|
8
|
+
$ gem install umarell
|
9
|
+
```
|
10
|
+
|
11
|
+
## Usage
|
12
|
+
|
13
|
+
Run `umarell` in a Ruby application's root directory
|
14
|
+
|
15
|
+
```sh
|
16
|
+
$ cd ruby-application
|
17
|
+
$ umarell
|
18
|
+
```
|
19
|
+
|
20
|
+
Run `umarell` with a target directory or file
|
21
|
+
|
22
|
+
```sh
|
23
|
+
$ umarell /path/to/ruby-application
|
24
|
+
```
|
25
|
+
|
26
|
+
### Options
|
27
|
+
|
28
|
+
```sh
|
29
|
+
$ umarell -h
|
30
|
+
|
31
|
+
usage: umarell [options] [target]
|
32
|
+
-a, --autofix Autofix violations (if supported)
|
33
|
+
```
|
34
|
+
|
35
|
+
## Requirements
|
36
|
+
|
37
|
+
* MRI 2.3+
|
38
|
+
|
39
|
+
## Tools included
|
40
|
+
|
41
|
+
Umarell runs the following tools:
|
42
|
+
- [bundler-audit](https://github.com/rubysec/bundler-audit)
|
43
|
+
- [brakeman](https://github.com/presidentbeef/brakeman)
|
44
|
+
- [rubocop](https://github.com/rubocop-hq/rubocop)
|
45
|
+
- [reek](https://github.com/troessner/reek)
|
46
|
+
- [rails_best_practices](https://github.com/flyerhzm/rails_best_practices)
|
47
|
+
- [fasterer](https://github.com/DamirSvrtan/fasterer)
|
48
|
+
|
49
|
+
## License
|
50
|
+
|
51
|
+
Copyright © 2019 [Nebulab](https://nebulab.it/).
|
52
|
+
It is free software, and may be redistributed under the terms specified in the [license](LICENSE.txt).
|
53
|
+
|
54
|
+
## About
|
55
|
+
|
56
|
+

|
57
|
+
|
58
|
+
Umarell is funded and maintained by the [Nebulab](http://nebulab.it/) team.
|
59
|
+
|
60
|
+
We firmly believe in the power of open-source. [Contact us](https://nebulab.it/contact-us/) if you like our work and you need help with your project design or development.
|
data/exe/umarell
ADDED
data/lib/umarell.rb
ADDED
data/lib/umarell/cli.rb
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'optparse'
|
4
|
+
|
5
|
+
module Umarell
|
6
|
+
TOOLS = {
|
7
|
+
bundler_audit: 'bundler-audit check --update',
|
8
|
+
brakeman: 'brakeman -w2 -q',
|
9
|
+
rubocop: 'rubocop',
|
10
|
+
reek: 'reek',
|
11
|
+
rails_best_practices: 'rails_best_practices',
|
12
|
+
fasterer: 'fasterer'
|
13
|
+
}.freeze
|
14
|
+
|
15
|
+
# The class responsible of handling command line logic
|
16
|
+
class CLI
|
17
|
+
def initialize(tools = TOOLS)
|
18
|
+
@tools = tools
|
19
|
+
@autofix = false
|
20
|
+
@args = {}
|
21
|
+
@target = ''
|
22
|
+
end
|
23
|
+
|
24
|
+
# Entry point to start the application
|
25
|
+
def run
|
26
|
+
parse_options
|
27
|
+
create_args
|
28
|
+
run_commands
|
29
|
+
end
|
30
|
+
|
31
|
+
private
|
32
|
+
|
33
|
+
def parse_options
|
34
|
+
OptionParser.new do |opts|
|
35
|
+
opts.banner = 'Usage: umarell [options] [target]'
|
36
|
+
|
37
|
+
opts.on('-a', '--autofix', 'Autofix violations (if supported)') do
|
38
|
+
@autofix = true
|
39
|
+
end
|
40
|
+
end.parse!
|
41
|
+
|
42
|
+
@target = ARGV.pop
|
43
|
+
end
|
44
|
+
|
45
|
+
def create_args
|
46
|
+
@args[:rubocop] = ['-a'] if @autofix
|
47
|
+
end
|
48
|
+
|
49
|
+
def run_commands
|
50
|
+
@tools.each do |name, command|
|
51
|
+
run_command(name, command, @args.fetch(name) { [] })
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
def run_command(name, command, args)
|
56
|
+
message = "\n\e[35m[Umarell] Running #{name}...\e[0m"
|
57
|
+
system "echo '#{message}'; #{command} #{args.join(' ')} #{@target}"
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
metadata
ADDED
@@ -0,0 +1,233 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: umarell
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Filippo Liverani
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-12-06 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: brakeman
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '4'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '4'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler-audit
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "<"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "<"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: fasterer
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "<"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "<"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rails_best_practices
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '1'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: reek
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '5'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '5'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rubocop
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "<"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '1'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "<"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '1'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rubocop-performance
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '1'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '1'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: rubocop-rails
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '2'
|
118
|
+
type: :runtime
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '2'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: rubocop-rake
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - "<"
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '1'
|
132
|
+
type: :runtime
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - "<"
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '1'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: rubocop-rspec
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - "~>"
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '1'
|
146
|
+
type: :runtime
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - "~>"
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '1'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: bundler
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - "~>"
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '2'
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - "~>"
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '2'
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: rake
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - "~>"
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '13'
|
174
|
+
type: :development
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - "~>"
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '13'
|
181
|
+
- !ruby/object:Gem::Dependency
|
182
|
+
name: rspec
|
183
|
+
requirement: !ruby/object:Gem::Requirement
|
184
|
+
requirements:
|
185
|
+
- - "~>"
|
186
|
+
- !ruby/object:Gem::Version
|
187
|
+
version: '3'
|
188
|
+
type: :development
|
189
|
+
prerelease: false
|
190
|
+
version_requirements: !ruby/object:Gem::Requirement
|
191
|
+
requirements:
|
192
|
+
- - "~>"
|
193
|
+
- !ruby/object:Gem::Version
|
194
|
+
version: '3'
|
195
|
+
description: All in one Ruby static code analyzer
|
196
|
+
email: hello@nebulab.it
|
197
|
+
executables:
|
198
|
+
- umarell
|
199
|
+
extensions: []
|
200
|
+
extra_rdoc_files:
|
201
|
+
- LICENSE.txt
|
202
|
+
- README.md
|
203
|
+
files:
|
204
|
+
- LICENSE.txt
|
205
|
+
- README.md
|
206
|
+
- exe/umarell
|
207
|
+
- lib/umarell.rb
|
208
|
+
- lib/umarell/cli.rb
|
209
|
+
- lib/umarell/version.rb
|
210
|
+
homepage: https://github.com/nebulab/umarell
|
211
|
+
licenses:
|
212
|
+
- MIT
|
213
|
+
metadata: {}
|
214
|
+
post_install_message:
|
215
|
+
rdoc_options: []
|
216
|
+
require_paths:
|
217
|
+
- lib
|
218
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
219
|
+
requirements:
|
220
|
+
- - ">="
|
221
|
+
- !ruby/object:Gem::Version
|
222
|
+
version: 2.3.0
|
223
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
224
|
+
requirements:
|
225
|
+
- - ">="
|
226
|
+
- !ruby/object:Gem::Version
|
227
|
+
version: '0'
|
228
|
+
requirements: []
|
229
|
+
rubygems_version: 3.0.6
|
230
|
+
signing_key:
|
231
|
+
specification_version: 4
|
232
|
+
summary: All in one Ruby static code analyzer
|
233
|
+
test_files: []
|