rubocop-diff 0.1.0 → 0.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: bf7fd55ff7a5da4e5573c6f3d2dfe0537d5413a7
4
- data.tar.gz: f711d91707bfbd26020be5b1c0514e3ba1dc6eb3
2
+ SHA256:
3
+ metadata.gz: f4410061bc0bee9c8845e1bcc9eab60e1734b569936cf6165445fe8376ce14ed
4
+ data.tar.gz: 70fdaa5548d4bf1531141e9bb514c7bb12052ae64a6bd08e758b3ab470dc6c4e
5
5
  SHA512:
6
- metadata.gz: 742188aceb00092ca87ebb25882d4ef35f551b70ce300731eea991ffb84acdedcc4f1ac21266f0cabe767a10fe6d3b4fc1d56c39305af69a7ab5329700525484
7
- data.tar.gz: 426bc61db04ab012747f52b9d7de3a81e8b793fe474279e484e81c8a0b2415a135299873efa6306677addb49f5828d4c19599cb9a09b85d1234df1e00d2dcb8a
6
+ metadata.gz: 80ed6197c3eace3409472a348788cd3666cd41dabd4ea6e71fdd59dca567b2770ad6eaf2482617fda0a166053b0f2784249d5ad4e73b36d1f2ba209af86f155e
7
+ data.tar.gz: cb3d8de855d24b3493b4ad44b84eedfac98071067841017939e1e3ab98fbd01ab7beca9f7dea982bab499a3b1452a463899273b334a64ed03a915ae076006eec
data/Gemfile CHANGED
@@ -2,3 +2,7 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in rubocop-diff.gemspec
4
4
  gemspec
5
+
6
+ group :test do
7
+ gem 'codeclimate-test-reporter', require: nil
8
+ end
data/README.md CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  Rubocop-diff runs rubocop, but gives you a report only for the lines you have changed. This can be useful in particularly nasty projects where you can't fix entire files at a time.
4
4
 
5
+ ![Build Status](https://travis-ci.org/mcgain/rubocop-diff.svg?branch=master) [![Code Climate](https://codeclimate.com/github/mcgain/rubocop-diff/badges/gpa.svg)](https://codeclimate.com/github/mcgain/rubocop-diff) [![Test Coverage](https://codeclimate.com/github/mcgain/rubocop-diff/badges/coverage.svg)](https://codeclimate.com/github/mcgain/rubocop-diff/coverage) [![Issue Count](https://codeclimate.com/github/mcgain/rubocop-diff/badges/issue_count.svg)](https://codeclimate.com/github/mcgain/rubocop-diff)
5
6
  ## Manual Dependencies
6
7
  Git: You will need git installed as rubocop-diff uses it to to figure out the diff
7
8
 
data/bin/rubocop-diff ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require_relative '../lib/rubocop/diff'
4
+ RuboCop::Diff.new.run($ARGV)
@@ -0,0 +1,22 @@
1
+ require 'rubocop/formatter/base_formatter'
2
+ module RuboCop
3
+ class Diff
4
+ class Formatter < RuboCop::Formatter::BaseFormatter
5
+
6
+ def initialize(*args)
7
+ exit(1) unless in_git_dir?
8
+ super
9
+ end
10
+
11
+ def file_finished(file, offenses)
12
+ puts "file_finished"
13
+ end
14
+
15
+ private
16
+
17
+ def in_git_dir?
18
+ Dir.exist?('.git')
19
+ end
20
+ end
21
+ end
22
+ end
@@ -1,5 +1,5 @@
1
1
  module Rubocop
2
2
  module Diff
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
data/lib/rubocop/diff.rb CHANGED
@@ -1,7 +1,14 @@
1
- require "rubocop/diff/version"
1
+ require 'rubocop'
2
+ $LOAD_PATH.unshift File.expand_path('../../', __FILE__)
3
+ require 'rubocop/diff/version'
4
+ require 'rubocop/diff/formatter'
2
5
 
3
- module Rubocop
4
- module Diff
5
- # Your code goes here...
6
+ module RuboCop
7
+ class Diff
8
+ def run(args)
9
+ args << ' --format'
10
+ args << ' RuboCop::Diff::Formatter'
11
+ RuboCop::CLI.new.run(args)
12
+ end
6
13
  end
7
14
  end
data/rubocop-diff.gemspec CHANGED
@@ -7,14 +7,14 @@ Gem::Specification.new do |spec|
7
7
  spec.name = 'rubocop-diff'
8
8
  spec.version = Rubocop::Diff::VERSION
9
9
  spec.authors = ['Richard McGain']
10
- spec.email = ['richard.mcgain@shopify.com']
10
+ spec.email = ['mcgain@gmail.com']
11
11
 
12
12
  spec.summary = %q{run rubocop only on your changes}
13
13
  spec.homepage = 'https://www.github.com/mcgain/rubocop-diff'
14
14
  spec.license = 'MIT'
15
15
 
16
16
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
17
- spec.bindir = 'exe'
17
+ spec.bindir = 'bin'
18
18
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
19
  spec.require_paths = ['lib']
20
20
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-diff
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard McGain
8
8
  autorequire:
9
- bindir: exe
9
+ bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-04 00:00:00.000000000 Z
11
+ date: 2023-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -68,7 +68,7 @@ dependencies:
68
68
  version: '0.37'
69
69
  description:
70
70
  email:
71
- - richard.mcgain@shopify.com
71
+ - mcgain@gmail.com
72
72
  executables: []
73
73
  extensions: []
74
74
  extra_rdoc_files: []
@@ -80,9 +80,9 @@ files:
80
80
  - LICENSE.txt
81
81
  - README.md
82
82
  - Rakefile
83
- - bin/console
84
- - bin/setup
83
+ - bin/rubocop-diff
85
84
  - lib/rubocop/diff.rb
85
+ - lib/rubocop/diff/formatter.rb
86
86
  - lib/rubocop/diff/version.rb
87
87
  - rubocop-diff.gemspec
88
88
  homepage: https://www.github.com/mcgain/rubocop-diff
@@ -104,8 +104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
104
104
  - !ruby/object:Gem::Version
105
105
  version: '0'
106
106
  requirements: []
107
- rubyforge_project:
108
- rubygems_version: 2.4.5.1
107
+ rubygems_version: 3.2.15
109
108
  signing_key:
110
109
  specification_version: 4
111
110
  summary: run rubocop only on your changes
data/bin/console DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "rubocop/diff"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "irb"
14
- IRB.start
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here