saddler 0.0.2 → 0.1.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c0f001bda35125b041d894da07196b1fbfaa9e8e
4
- data.tar.gz: 717514af9b6c3bfbf43a2ac60d7dd66e3d22dc4d
3
+ metadata.gz: 1e3cbd21f10fa179c70115b166487b2801affe9f
4
+ data.tar.gz: 7d52f4d658b072a55228af8bf7e6f7ad1b7c8734
5
5
  SHA512:
6
- metadata.gz: 02e77eaaa3b3588b4155a02b5a0c43864626d3c6f5f93ac8cc216e11966ef06d8f79d316de85d988d14dfa48ae516a82934c154ccb63e2965ae4922582bc3987
7
- data.tar.gz: 9c53e08d4b77d59e179cf40a9e4c9e0fcb32df9c725366750995f539f86bc8ac0eacfe7950413ee13c6b9a5b471ed881abe98364eedeb313602b2d87d1d6c273
6
+ metadata.gz: 3238a6968d4d42c80db96bde6f27646ae5a13355cdbae6826d53e71a2c60403f257a3ea48d64136a03ea1b802f6aa275c5b0a3ab7bdd0dd04640a0d69078bad6
7
+ data.tar.gz: 7a049c9cc75960625608e315699cf7cb8b638035e4ae24dea1f4c853dba1c0b6e9805c057264989ffc21833e880eee8a36eca78953b7c06143004c7fd46d1cdb
data/Gemfile CHANGED
@@ -2,3 +2,5 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in saddler.gemspec
4
4
  gemspec
5
+ gem 'byebug' if RUBY_VERSION >= '2.0.0'
6
+ gem 'pry'
data/README.md CHANGED
@@ -3,6 +3,31 @@
3
3
  [![Gem Version](http://img.shields.io/gem/v/saddler.svg?style=flat)](http://badge.fury.io/rb/saddler)
4
4
  [![Build Status](http://img.shields.io/travis/packsaddle/ruby-saddler/master.svg?style=flat)](https://travis-ci.org/packsaddle/ruby-saddler)
5
5
 
6
+ **checkstyle2anywhere**, you can exec any lint, security checker and tools.
7
+
8
+ ## Usage
9
+
10
+ ```
11
+ git diff -z --name-only ..origin/master \
12
+ | xargs -0 rubocop-select \
13
+ | xargs rubocop \
14
+ --require rubocop/formatter/checkstyle_formatter \
15
+ --format RuboCop::Formatter::CheckstyleFormatter \
16
+ | checkstyle_filter-git diff ..origin/master \
17
+ | saddler report \
18
+ --require saddler/reporter/github \
19
+ --reporter Saddler::Reporter::Github::PullRequestReviewComment
20
+ ```
21
+
22
+ It works!
23
+
24
+ You can run this from any CI Service (e.g. circle-ci, travis-ci, jenkins, etc).
25
+
26
+ ## Reporters
27
+
28
+ * [saddler-reporter-text](https://github.com/packsaddle/ruby-saddler-reporter-text)
29
+ * [saddler-reporter-github](https://github.com/packsaddle/ruby-saddler-reporter-github)
30
+
6
31
  ## Installation
7
32
 
8
33
  Add this line to your application's Gemfile:
@@ -19,10 +44,6 @@ Or install it yourself as:
19
44
 
20
45
  $ gem install saddler
21
46
 
22
- ## Usage
23
-
24
- TODO: Write usage instructions here
25
-
26
47
  ## Development
27
48
 
28
49
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment. Run `bundle exec saddler` to use the code located in this directory, ignoring other installed copies of this gem.
File without changes
data/bin/setup CHANGED
File without changes
@@ -0,0 +1,3 @@
1
+ def foo
2
+ 'ggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg'
3
+ end
@@ -0,0 +1,6 @@
1
+ <?xml version='1.0'?>
2
+ <checkstyle>
3
+ <file name='/Users/sane/work/ruby-study/saddler/example/invalid.rb'>
4
+ <error line='2' column='100' severity='info' message='Line is too long. [117/100]' source='com.puppycrawl.tools.checkstyle.Metrics/LineLength'/>
5
+ </file>
6
+ </checkstyle>
@@ -0,0 +1,13 @@
1
+ git diff -z --name-only ee0e288...2956a73 \
2
+ | xargs -0 rubocop-select \
3
+ | xargs rubocop \
4
+ --require rubocop/formatter/checkstyle_formatter \
5
+ --format RuboCop::Formatter::CheckstyleFormatter \
6
+ > example/rubocop-result.xml
7
+
8
+ GITHUB_ACCESS_TOKEN=token \
9
+ bundle exec exe/saddler report \
10
+ --file example/rubocop-result.xml \
11
+ --require saddler/reporter/github \
12
+ --reporter Saddler::Reporter::Github::CommitReviewComment \
13
+ --options sha1:ce3b17679fee03a6a3c262a3ad2f881d5fb65ff7
@@ -16,13 +16,13 @@ module Saddler
16
16
  desc 'report', 'Exec Report'
17
17
  option :data
18
18
  option :file
19
- option :repo
19
+ option :options, type: :hash, default: {}
20
20
  option :require
21
21
  option :reporter
22
22
  def report
23
23
  data = \
24
24
  if options[:data]
25
- options[:data]
25
+ options[:data]
26
26
  elsif options[:file]
27
27
  File.read(options[:file])
28
28
  elsif !$stdin.tty?
@@ -32,16 +32,13 @@ module Saddler
32
32
 
33
33
  abort('no input') if !data || data.empty?
34
34
 
35
- pass_options = {}
36
- pass_options[:repo] = options[:repo] if options[:repo]
37
-
38
35
  require options[:require] if options[:require]
39
- if(options[:reporter])
36
+ if options[:reporter]
40
37
  reporter = ::Saddler::Reporter.add_reporter(options[:reporter], $stdout)
41
38
  end
42
39
 
43
40
  abort('no reporter') unless reporter
44
- reporter.report(data, pass_options)
41
+ reporter.report(data, options[:options])
45
42
  end
46
43
  end
47
44
  end
@@ -1,3 +1,3 @@
1
1
  module Saddler
2
- VERSION = '0.0.2'
2
+ VERSION = '0.1.0'
3
3
  end
@@ -24,5 +24,5 @@ Gem::Specification.new do |spec|
24
24
 
25
25
  spec.add_development_dependency 'bundler', '~> 1.8'
26
26
  spec.add_development_dependency 'rake', '~> 10.0'
27
- spec.add_development_dependency 'minitest'
27
+ spec.add_development_dependency 'test-unit'
28
28
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: saddler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - sanemat
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-02-18 00:00:00.000000000 Z
11
+ date: 2015-02-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -67,7 +67,7 @@ dependencies:
67
67
  - !ruby/object:Gem::Version
68
68
  version: '10.0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: minitest
70
+ name: test-unit
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - ">="
@@ -98,6 +98,9 @@ files:
98
98
  - Rakefile
99
99
  - bin/console
100
100
  - bin/setup
101
+ - example/invalid.rb
102
+ - example/rubocop-result.xml
103
+ - example/simple.txt
101
104
  - exe/saddler
102
105
  - lib/saddler.rb
103
106
  - lib/saddler/cli.rb