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 +5 -5
- data/Gemfile +4 -0
- data/README.md +1 -0
- data/bin/rubocop-diff +4 -0
- data/lib/rubocop/diff/formatter.rb +22 -0
- data/lib/rubocop/diff/version.rb +1 -1
- data/lib/rubocop/diff.rb +11 -4
- data/rubocop-diff.gemspec +2 -2
- metadata +7 -8
- data/bin/console +0 -14
- data/bin/setup +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: f4410061bc0bee9c8845e1bcc9eab60e1734b569936cf6165445fe8376ce14ed
|
4
|
+
data.tar.gz: 70fdaa5548d4bf1531141e9bb514c7bb12052ae64a6bd08e758b3ab470dc6c4e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 80ed6197c3eace3409472a348788cd3666cd41dabd4ea6e71fdd59dca567b2770ad6eaf2482617fda0a166053b0f2784249d5ad4e73b36d1f2ba209af86f155e
|
7
|
+
data.tar.gz: cb3d8de855d24b3493b4ad44b84eedfac98071067841017939e1e3ab98fbd01ab7beca9f7dea982bab499a3b1452a463899273b334a64ed03a915ae076006eec
|
data/Gemfile
CHANGED
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
|
+
 [](https://codeclimate.com/github/mcgain/rubocop-diff) [](https://codeclimate.com/github/mcgain/rubocop-diff/coverage) [](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,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
|
data/lib/rubocop/diff/version.rb
CHANGED
data/lib/rubocop/diff.rb
CHANGED
@@ -1,7 +1,14 @@
|
|
1
|
-
require
|
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
|
4
|
-
|
5
|
-
|
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 = ['
|
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 = '
|
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.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard McGain
|
8
8
|
autorequire:
|
9
|
-
bindir:
|
9
|
+
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
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
|
-
-
|
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/
|
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
|
-
|
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
|