rubocop-github 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 0fb65f2420029886164d78ce065e0af16594e0e8
4
+ data.tar.gz: d9544f86a42756426a5d09a674d8626db046cd67
5
+ SHA512:
6
+ metadata.gz: dd9bc6ad99bd07d55589e4e097135e4655c73b4efae0ba982eebf737ff7aae858d6528c12d2df9341864e9135fd398336e8d1604ddc775de3bc1994ed41ff571
7
+ data.tar.gz: 6cffe417060b9ed6b2c7a57110ab5d84b48e9f0a622a6a588f8e47f562f678ddd4cee697627f7bc8b070c703736a3c98408f4ce4fd3eb5bfc61fe209690bd138
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2017 GitHub, Inc.
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,22 @@
1
+ # RuboCop GitHub
2
+
3
+ This repository provides recommended RuboCop configuration and additional Cops for use on GitHub open source and internal Ruby projects.
4
+
5
+ ## Installation
6
+
7
+ **Gemfile**
8
+
9
+ ``` ruby
10
+ gem "rubocop-github"
11
+ ```
12
+
13
+ **.rubocop.yml**
14
+
15
+ ``` yaml
16
+ inherit_gem:
17
+ rubocop-github: config/default.yml
18
+ ```
19
+
20
+ ## The Cops
21
+
22
+ All cops are located under [`lib/rubocop/cop/github`](lib/rubocop/cop/github), and contain examples/documentation.
@@ -0,0 +1,10 @@
1
+ require: rubocop/cop/github
2
+
3
+ AllCops:
4
+ DisabledByDefault: true
5
+
6
+ GitHub/ApplicationRecord:
7
+ Enabled: true
8
+
9
+ Style/TrailingWhitespace:
10
+ Enabled: true
@@ -0,0 +1 @@
1
+ require "rubocop/cop/github/application_record"
@@ -0,0 +1,21 @@
1
+ require "rubocop"
2
+
3
+ module RuboCop
4
+ module Cop
5
+ module GitHub
6
+ class ApplicationRecord < Cop
7
+ MSG = "Models should subclass from ApplicationRecord"
8
+
9
+ ACTIVE_RECORD_BASE = s(:const, s(:const, nil, :ActiveRecord), :Base)
10
+
11
+ def on_class(node)
12
+ _name, superclass, _body = *node
13
+
14
+ if superclass == ACTIVE_RECORD_BASE
15
+ add_offense(superclass, :expression)
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
metadata ADDED
@@ -0,0 +1,90 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rubocop-github
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - GitHub
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-12-10 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rubocop
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.46'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0.46'
27
+ - !ruby/object:Gem::Dependency
28
+ name: minitest
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '5.10'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '5.10'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '12.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '12.0'
55
+ description: 'Code style checking for GitHub Ruby repositories '
56
+ email: engineering@github.com
57
+ executables: []
58
+ extensions: []
59
+ extra_rdoc_files: []
60
+ files:
61
+ - LICENSE
62
+ - README.md
63
+ - config/default.yml
64
+ - lib/rubocop/cop/github.rb
65
+ - lib/rubocop/cop/github/application_record.rb
66
+ homepage: https://github.com/github/rubocop-github
67
+ licenses:
68
+ - MIT
69
+ metadata: {}
70
+ post_install_message:
71
+ rdoc_options: []
72
+ require_paths:
73
+ - lib
74
+ required_ruby_version: !ruby/object:Gem::Requirement
75
+ requirements:
76
+ - - ">="
77
+ - !ruby/object:Gem::Version
78
+ version: 2.3.0
79
+ required_rubygems_version: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - ">="
82
+ - !ruby/object:Gem::Version
83
+ version: '0'
84
+ requirements: []
85
+ rubyforge_project:
86
+ rubygems_version: 2.5.2
87
+ signing_key:
88
+ specification_version: 4
89
+ summary: RuboCop GitHub
90
+ test_files: []