cs-rubocop-git 0.1.4

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.
Files changed (56) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +11 -0
  3. data/.travis.yml +32 -0
  4. data/Appraisals +31 -0
  5. data/Gemfile +3 -0
  6. data/LICENSE.txt +26 -0
  7. data/README.md +46 -0
  8. data/Rakefile +15 -0
  9. data/bin/rubocop-git +5 -0
  10. data/gemfiles/0.24.gemfile +7 -0
  11. data/gemfiles/0.25.gemfile +7 -0
  12. data/gemfiles/0.26.gemfile +7 -0
  13. data/gemfiles/0.27.gemfile +7 -0
  14. data/gemfiles/0.28.gemfile +7 -0
  15. data/gemfiles/0.29.gemfile +7 -0
  16. data/gemfiles/0.30.gemfile +7 -0
  17. data/gemfiles/0.31.gemfile +7 -0
  18. data/gemfiles/0.32.gemfile +7 -0
  19. data/gemfiles/0.33.gemfile +7 -0
  20. data/gemfiles/0.34.gemfile +7 -0
  21. data/gemfiles/0.35.gemfile +7 -0
  22. data/gemfiles/0.36.gemfile +7 -0
  23. data/gemfiles/0.37.gemfile +7 -0
  24. data/gemfiles/0.38.gemfile +7 -0
  25. data/gemfiles/0.39.gemfile +7 -0
  26. data/gemfiles/0.40.gemfile +7 -0
  27. data/gemfiles/0.41.gemfile +7 -0
  28. data/gemfiles/0.42.gemfile +7 -0
  29. data/gemfiles/0.43.gemfile +7 -0
  30. data/gemfiles/0.44.gemfile +7 -0
  31. data/gemfiles/0.45.gemfile +7 -0
  32. data/gemfiles/0.46.gemfile +7 -0
  33. data/gemfiles/0.47.gemfile +7 -0
  34. data/gemfiles/0.48.gemfile +7 -0
  35. data/hound.yml +254 -0
  36. data/lib/rubocop/git.rb +19 -0
  37. data/lib/rubocop/git/cli.rb +67 -0
  38. data/lib/rubocop/git/commit.rb +22 -0
  39. data/lib/rubocop/git/commit_file.rb +55 -0
  40. data/lib/rubocop/git/diff_parser.rb +31 -0
  41. data/lib/rubocop/git/file_violation.rb +5 -0
  42. data/lib/rubocop/git/line.rb +8 -0
  43. data/lib/rubocop/git/options.rb +84 -0
  44. data/lib/rubocop/git/patch.rb +36 -0
  45. data/lib/rubocop/git/pseudo_pull_request.rb +36 -0
  46. data/lib/rubocop/git/pseudo_resource.rb +24 -0
  47. data/lib/rubocop/git/runner.rb +70 -0
  48. data/lib/rubocop/git/style_checker.rb +43 -0
  49. data/lib/rubocop/git/style_guide.rb +98 -0
  50. data/lib/rubocop/git/version.rb +5 -0
  51. data/rubocop-git.gemspec +27 -0
  52. data/test/rubocop/git/cli_test.rb +12 -0
  53. data/test/rubocop/git/options_test.rb +18 -0
  54. data/test/rubocop/git/runner_test.rb +23 -0
  55. data/test/test_helper.rb +2 -0
  56. metadata +172 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 161939170f5c012d67cff015344a68ffa31efa4f7aefd5668aa656d418903e0c
4
+ data.tar.gz: 9d4aa99842a8463fa4a7ad2e077c5154bbfc26018b9f97b2998d6ce55086d8c0
5
+ SHA512:
6
+ metadata.gz: db2aef5113dfc8209645117fef7b690da6aba43b7d523816badbf4bd39e3ef3034d25c9408710738f0e8c9ab78819d22ac6f4d71f18ac71c512e0c2353d4f6cf
7
+ data.tar.gz: ba7278da1eeee3363dbb0a754d42f824af90e93007688018276180ee18adebf3beaf1b9372eb74051fc71c890bdf5f3c45772d8bfcb406c8ffbfd5a8a81450a1
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+
11
+ /gemfiles/*.gemfile.lock
@@ -0,0 +1,32 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.1.10
4
+ - 2.4.1
5
+ gemfile:
6
+ - gemfiles/0.24.gemfile
7
+ - gemfiles/0.25.gemfile
8
+ - gemfiles/0.26.gemfile
9
+ - gemfiles/0.27.gemfile
10
+ - gemfiles/0.28.gemfile
11
+ - gemfiles/0.29.gemfile
12
+ - gemfiles/0.30.gemfile
13
+ - gemfiles/0.31.gemfile
14
+ - gemfiles/0.32.gemfile
15
+ - gemfiles/0.33.gemfile
16
+ - gemfiles/0.34.gemfile
17
+ - gemfiles/0.35.gemfile
18
+ - gemfiles/0.36.gemfile
19
+ - gemfiles/0.37.gemfile
20
+ - gemfiles/0.38.gemfile
21
+ - gemfiles/0.39.gemfile
22
+ - gemfiles/0.40.gemfile
23
+ - gemfiles/0.41.gemfile
24
+ - gemfiles/0.42.gemfile
25
+ - gemfiles/0.43.gemfile
26
+ - gemfiles/0.44.gemfile
27
+ - gemfiles/0.45.gemfile
28
+ - gemfiles/0.46.gemfile
29
+ - gemfiles/0.47.gemfile
30
+ - gemfiles/0.48.gemfile
31
+ before_install:
32
+ - gem update --system
@@ -0,0 +1,31 @@
1
+ %w(
2
+ 0.24.1
3
+ 0.25.0
4
+ 0.26.1
5
+ 0.27.1
6
+ 0.28.0
7
+ 0.29.1
8
+ 0.30.1
9
+ 0.31.0
10
+ 0.32.1
11
+ 0.33.0
12
+ 0.34.2
13
+ 0.35.1
14
+ 0.36.0
15
+ 0.37.2
16
+ 0.38.0
17
+ 0.39.0
18
+ 0.40.0
19
+ 0.41.2
20
+ 0.42.0
21
+ 0.43.0
22
+ 0.44.1
23
+ 0.45.0
24
+ 0.46.0
25
+ 0.47.1
26
+ 0.48.1
27
+ ).each do |version|
28
+ appraise version[/\d+\.\d+/] do
29
+ gem 'rubocop', version
30
+ end
31
+ end
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
@@ -0,0 +1,26 @@
1
+ Copyright (c) 2014 Masaki Takeuchi
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
+
24
+ Some code is:
25
+ Copyright (c) 2014 thoughtbot, inc.
26
+ Released under the MIT License in Hound, https://github.com/thoughtbot/hound
@@ -0,0 +1,46 @@
1
+ # RuboCop::Git
2
+
3
+ RuboCop for git diff.
4
+
5
+ [![Gem Version](https://badge.fury.io/rb/rubocop-git.svg)](http://badge.fury.io/rb/rubocop-git)
6
+ [![Build Status](https://travis-ci.org/m4i/rubocop-git.svg?branch=master)](https://travis-ci.org/m4i/rubocop-git)
7
+ [![Code Climate](https://codeclimate.com/github/m4i/rubocop-git.png)](https://codeclimate.com/github/m4i/rubocop-git)
8
+
9
+ ## Notice
10
+
11
+ This is a fork, created because the original project doesn't seem to be
12
+ maintained anymore. Should there be any issue, please check the pull-request
13
+ for the original project, there is a good chance it has already been fixed.
14
+
15
+ ## Installation
16
+
17
+ Add this line to your application's Gemfile:
18
+
19
+ gem 'rubocop-git'
20
+
21
+ And then execute:
22
+
23
+ $ bundle
24
+
25
+ Or install it yourself as:
26
+
27
+ $ gem install rubocop-git
28
+
29
+ ## Usage
30
+
31
+ Usage: rubocop-git [options] [[commit] commit]
32
+ -c, --config FILE Specify configuration file
33
+ -r, --require FILE Require Ruby file
34
+ -d, --debug Display debug info
35
+ -D, --display-cop-names Display cop names in offense messages
36
+ --cached git diff --cached
37
+ --staged synonym of --cached
38
+ --hound Hound compatibility mode
39
+
40
+ ## Contributing
41
+
42
+ 1. Fork it ( https://github.com/m4i/rubocop-git/fork )
43
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
44
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
45
+ 4. Push to the branch (`git push origin my-new-feature`)
46
+ 5. Create a new Pull Request
@@ -0,0 +1,15 @@
1
+ require 'bundler/gem_tasks'
2
+ require 'rake/testtask'
3
+ require 'appraisal'
4
+
5
+ Rake::TestTask.new(:test) do |t|
6
+ t.libs << 'test'
7
+ t.libs << 'lib'
8
+ t.test_files = FileList['test/**/*_test.rb']
9
+ end
10
+
11
+ if ENV['APPRAISAL_INITIALIZED'] || ENV['TRAVIS']
12
+ task default: :test
13
+ else
14
+ task default: :appraisal
15
+ end
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'rubocop/git/cli'
4
+
5
+ RuboCop::Git::CLI.new.run
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rubocop", "0.24.1"
6
+
7
+ gemspec :path => "../"
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rubocop", "0.25.0"
6
+
7
+ gemspec :path => "../"
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rubocop", "0.26.1"
6
+
7
+ gemspec :path => "../"
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rubocop", "0.27.1"
6
+
7
+ gemspec :path => "../"
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rubocop", "0.28.0"
6
+
7
+ gemspec :path => "../"
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rubocop", "0.29.1"
6
+
7
+ gemspec :path => "../"
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rubocop", "0.30.1"
6
+
7
+ gemspec :path => "../"
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rubocop", "0.31.0"
6
+
7
+ gemspec :path => "../"
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rubocop", "0.32.1"
6
+
7
+ gemspec :path => "../"
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rubocop", "0.33.0"
6
+
7
+ gemspec :path => "../"
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rubocop", "0.34.2"
6
+
7
+ gemspec :path => "../"
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rubocop", "0.35.1"
6
+
7
+ gemspec :path => "../"
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rubocop", "0.36.0"
6
+
7
+ gemspec :path => "../"
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rubocop", "0.37.2"
6
+
7
+ gemspec :path => "../"
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rubocop", "0.38.0"
6
+
7
+ gemspec :path => "../"
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rubocop", "0.39.0"
6
+
7
+ gemspec :path => "../"
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rubocop", "0.40.0"
6
+
7
+ gemspec :path => "../"
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rubocop", "0.41.2"
6
+
7
+ gemspec :path => "../"
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rubocop", "0.42.0"
6
+
7
+ gemspec :path => "../"
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rubocop", "0.43.0"
6
+
7
+ gemspec :path => "../"
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rubocop", "0.44.1"
6
+
7
+ gemspec :path => "../"
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rubocop", "0.45.0"
6
+
7
+ gemspec :path => "../"
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rubocop", "0.46.0"
6
+
7
+ gemspec :path => "../"
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rubocop", "0.47.1"
6
+
7
+ gemspec :path => "../"
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rubocop", "0.48.1"
6
+
7
+ gemspec :path => "../"
@@ -0,0 +1,254 @@
1
+ AllCops:
2
+ Exclude:
3
+ - db/schema.rb
4
+
5
+ AccessorMethodName:
6
+ Enabled: false
7
+
8
+ ActionFilter:
9
+ Enabled: false
10
+
11
+ Alias:
12
+ Enabled: false
13
+
14
+ ArrayJoin:
15
+ Enabled: false
16
+
17
+ AsciiComments:
18
+ Enabled: false
19
+
20
+ AsciiIdentifiers:
21
+ Enabled: false
22
+
23
+ Attr:
24
+ Enabled: false
25
+
26
+ BlockNesting:
27
+ Enabled: false
28
+
29
+ CaseEquality:
30
+ Enabled: false
31
+
32
+ CharacterLiteral:
33
+ Enabled: false
34
+
35
+ ClassAndModuleChildren:
36
+ Enabled: false
37
+
38
+ ClassLength:
39
+ Enabled: false
40
+
41
+ ClassVars:
42
+ Enabled: false
43
+
44
+ CollectionMethods:
45
+ PreferredMethods:
46
+ find: detect
47
+ reduce: inject
48
+ collect: map
49
+ find_all: select
50
+
51
+ ColonMethodCall:
52
+ Enabled: false
53
+
54
+ CommentAnnotation:
55
+ Enabled: false
56
+
57
+ CyclomaticComplexity:
58
+ Enabled: false
59
+
60
+ Delegate:
61
+ Enabled: false
62
+
63
+ DeprecatedHashMethods:
64
+ Enabled: false
65
+
66
+ Documentation:
67
+ Enabled: false
68
+
69
+ DotPosition:
70
+ EnforcedStyle: trailing
71
+
72
+ DoubleNegation:
73
+ Enabled: false
74
+
75
+ EachWithObject:
76
+ Enabled: false
77
+
78
+ EmptyLiteral:
79
+ Enabled: false
80
+
81
+ Encoding:
82
+ Enabled: false
83
+
84
+ EvenOdd:
85
+ Enabled: false
86
+
87
+ FileName:
88
+ Enabled: false
89
+
90
+ FlipFlop:
91
+ Enabled: false
92
+
93
+ FormatString:
94
+ Enabled: false
95
+
96
+ GlobalVars:
97
+ Enabled: false
98
+
99
+ GuardClause:
100
+ Enabled: false
101
+
102
+ IfUnlessModifier:
103
+ Enabled: false
104
+
105
+ IfWithSemicolon:
106
+ Enabled: false
107
+
108
+ Lambda:
109
+ Enabled: false
110
+
111
+ LambdaCall:
112
+ Enabled: false
113
+
114
+ LineEndConcatenation:
115
+ Enabled: false
116
+
117
+ LineLength:
118
+ Max: 80
119
+
120
+ MethodLength:
121
+ Enabled: false
122
+
123
+ ModuleFunction:
124
+ Enabled: false
125
+
126
+ NegatedIf:
127
+ Enabled: false
128
+
129
+ NegatedWhile:
130
+ Enabled: false
131
+
132
+ NilComparison:
133
+ Enabled: false
134
+
135
+ Not:
136
+ Enabled: false
137
+
138
+ NumericLiterals:
139
+ Enabled: false
140
+
141
+ OneLineConditional:
142
+ Enabled: false
143
+
144
+ OpMethod:
145
+ Enabled: false
146
+
147
+ ParameterLists:
148
+ Enabled: false
149
+
150
+ PercentLiteralDelimiters:
151
+ PreferredDelimiters:
152
+ '%': '{}'
153
+
154
+ PerlBackrefs:
155
+ Enabled: false
156
+
157
+ PredicateName:
158
+ NamePrefixBlacklist:
159
+ - is_
160
+
161
+ Proc:
162
+ Enabled: false
163
+
164
+ RaiseArgs:
165
+ Enabled: false
166
+
167
+ RegexpLiteral:
168
+ Enabled: false
169
+
170
+ SelfAssignment:
171
+ Enabled: false
172
+
173
+ SingleLineBlockParams:
174
+ Enabled: false
175
+
176
+ SingleLineMethods:
177
+ Enabled: false
178
+
179
+ SignalException:
180
+ Enabled: false
181
+
182
+ SpecialGlobalVars:
183
+ Enabled: false
184
+
185
+ StringLiterals:
186
+ EnforcedStyle: double_quotes
187
+
188
+ VariableInterpolation:
189
+ Enabled: false
190
+
191
+ TrailingComma:
192
+ Enabled: false
193
+
194
+ TrivialAccessors:
195
+ Enabled: false
196
+
197
+ VariableInterpolation:
198
+ Enabled: false
199
+
200
+ WhenThen:
201
+ Enabled: false
202
+
203
+ WhileUntilModifier:
204
+ Enabled: false
205
+
206
+ WordArray:
207
+ Enabled: false
208
+
209
+ # Lint
210
+
211
+ AmbiguousOperator:
212
+ Enabled: false
213
+
214
+ AmbiguousRegexpLiteral:
215
+ Enabled: false
216
+
217
+ AssignmentInCondition:
218
+ Enabled: false
219
+
220
+ ConditionPosition:
221
+ Enabled: false
222
+
223
+ DeprecatedClassMethods:
224
+ Enabled: false
225
+
226
+ ElseLayout:
227
+ Enabled: false
228
+
229
+ HandleExceptions:
230
+ Enabled: false
231
+
232
+ InvalidCharacterLiteral:
233
+ Enabled: false
234
+
235
+ LiteralInCondition:
236
+ Enabled: false
237
+
238
+ LiteralInInterpolation:
239
+ Enabled: false
240
+
241
+ Loop:
242
+ Enabled: false
243
+
244
+ ParenthesesAsGroupedExpression:
245
+ Enabled: false
246
+
247
+ RequireParentheses:
248
+ Enabled: false
249
+
250
+ UnderscorePrefixedVariableName:
251
+ Enabled: false
252
+
253
+ Void:
254
+ Enabled: false