cider_ci-support 1.0.0 → 1.1.0.pre.beta.1
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/README.md +9 -0
- data/bin/cider-ci_flog +82 -0
- data/cider_ci-support.gemspec +1 -0
- data/lib/cider_ci/support/version.rb +1 -1
- metadata +19 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a415fa7aff023229703f9130d401ab041767d358
|
4
|
+
data.tar.gz: ab1737be91d7c31c6a8afb1472e5a603c7ad0f21
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d059856c0596a5955facc58f1d7935afa22236e85867375e92b440a331c91536e893215b0e6f504c7b1fad59d6717151d4ade289fd416e85761712d195a2526
|
7
|
+
data.tar.gz: 2a8d008e3c731c20615a237a46351358761b14952a40178cc79c8bde11bfff0def507e2736f44b8e17f3e42b9a5455722e490e79f1d438f8e4c482d691ae9f5e
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -54,3 +54,12 @@ gem 'cider_ci-support', '~> 1.0.0'
|
|
54
54
|
~~~
|
55
55
|
|
56
56
|
|
57
|
+
### Static code analysis with `cider-ci_flog`
|
58
|
+
|
59
|
+
`cider-ci_flog` uses [flog][] to perform a static code analysis. It exits with
|
60
|
+
0 if and only if there are no offenders. The original `flog` always exits with
|
61
|
+
0. Therefore `cider-ci_flog` lends itself to be used within a task of
|
62
|
+
a Cider-CI execution suite.
|
63
|
+
|
64
|
+
[flog]: http://ruby.sadi.st/Flog.html
|
65
|
+
|
data/bin/cider-ci_flog
ADDED
@@ -0,0 +1,82 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'optparse'
|
4
|
+
require 'ostruct'
|
5
|
+
require 'yaml'
|
6
|
+
require 'flog_cli'
|
7
|
+
require 'flog'
|
8
|
+
|
9
|
+
# require 'pry'
|
10
|
+
|
11
|
+
|
12
|
+
###############################################################################
|
13
|
+
|
14
|
+
#
|
15
|
+
# Authors: Thomas Schank <DrTom@schank.ch>
|
16
|
+
#
|
17
|
+
###############################################################################
|
18
|
+
|
19
|
+
|
20
|
+
###############################################################################
|
21
|
+
# Options, main ....
|
22
|
+
###############################################################################
|
23
|
+
|
24
|
+
|
25
|
+
def parse_options options
|
26
|
+
|
27
|
+
optparse = OptionParser.new do |opts|
|
28
|
+
opts.banner = "Usage: cider-ci_flog FILE/DIR ..."
|
29
|
+
|
30
|
+
opts.on('-l', '--limit N', Integer) do |l|
|
31
|
+
options.limit= l
|
32
|
+
end
|
33
|
+
|
34
|
+
opts.on('-d', '--print-details') do
|
35
|
+
options.print_details= true
|
36
|
+
end
|
37
|
+
|
38
|
+
|
39
|
+
|
40
|
+
end.parse!
|
41
|
+
|
42
|
+
options
|
43
|
+
end
|
44
|
+
|
45
|
+
|
46
|
+
def main
|
47
|
+
options = OpenStruct.new
|
48
|
+
options.limit= 30
|
49
|
+
options.print_details= false
|
50
|
+
|
51
|
+
parse_options options
|
52
|
+
|
53
|
+
files= FlogCLI.expand_dirs_to_files ARGV
|
54
|
+
|
55
|
+
flog_options = FlogCLI.parse_options []
|
56
|
+
flogger= Flog.new flog_options
|
57
|
+
flogger.flog *files
|
58
|
+
|
59
|
+
offending= flogger.totals \
|
60
|
+
.select{|k,v| v > options.limit} \
|
61
|
+
.sort_by{ |k,v| -v}
|
62
|
+
|
63
|
+
if offending.empty?
|
64
|
+
$stdout.puts "cider-ci_flog OK"
|
65
|
+
exit
|
66
|
+
else
|
67
|
+
$stderr.puts "cider-ci_flog FAILED:"
|
68
|
+
offending.each do |offender|
|
69
|
+
$stderr.puts "" if options.print_details
|
70
|
+
|
71
|
+
$stderr.puts "#{offender[1].round} #{offender[0]}"
|
72
|
+
if options.print_details
|
73
|
+
$stderr.puts flogger.calls[offender[0]].to_yaml
|
74
|
+
end
|
75
|
+
end
|
76
|
+
abort
|
77
|
+
end
|
78
|
+
|
79
|
+
end
|
80
|
+
|
81
|
+
main
|
82
|
+
|
data/cider_ci-support.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cider_ci-support
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.1.0.pre.beta.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thomas Schank
|
@@ -94,11 +94,26 @@ dependencies:
|
|
94
94
|
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: 1.0.0.pre.beta.2
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: flog
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 4.3.0
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 4.3.0
|
97
111
|
description: ''
|
98
112
|
email:
|
99
113
|
- DrTom@schank.ch
|
100
114
|
executables:
|
101
115
|
- cider-ci_coverage
|
116
|
+
- cider-ci_flog
|
102
117
|
extensions: []
|
103
118
|
extra_rdoc_files: []
|
104
119
|
files:
|
@@ -108,6 +123,7 @@ files:
|
|
108
123
|
- README.md
|
109
124
|
- Rakefile
|
110
125
|
- bin/cider-ci_coverage
|
126
|
+
- bin/cider-ci_flog
|
111
127
|
- cider_ci-support.gemspec
|
112
128
|
- lib/cider_ci/support.rb
|
113
129
|
- lib/cider_ci/support/version.rb
|
@@ -126,9 +142,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
126
142
|
version: '0'
|
127
143
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
128
144
|
requirements:
|
129
|
-
- - "
|
145
|
+
- - ">"
|
130
146
|
- !ruby/object:Gem::Version
|
131
|
-
version:
|
147
|
+
version: 1.3.1
|
132
148
|
requirements: []
|
133
149
|
rubyforge_project:
|
134
150
|
rubygems_version: 2.2.2
|