mavenlint 1.1.1 → 1.2.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: 00bca785c140f5c034c9977fb69cdc6b1cf5969b
4
- data.tar.gz: 61434659e9f5bd87c794db25ae9cd632584f4e07
3
+ metadata.gz: 2e57e6b765719b7164b7c2e36263ae7d8b0a947d
4
+ data.tar.gz: df6b9495132aa2eb56678302654b73a83e31cb9d
5
5
  SHA512:
6
- metadata.gz: 197eaa339fad01ae1e3d6c683321f9755a65bd47a30d4d0efed39a38ac5288139994055850da93203f397ca77ce8bb237d71549ce1626fb5fec4d2af39619036
7
- data.tar.gz: 80dda4fe38ea6c5dc33f094bfa4221215472683619be6be86e3f36f6792ed997b58120dd13b55374c2bb7adfe8fb6c76385829f75009e47123b7e8a6bbece8fe
6
+ metadata.gz: c156fe41059f0a195350808199859bdcb27813ab3342dc994e21f063f7f2568611793ec212d8b247a439d9978e9c8bbbd25ceda1a9b69af1a45182d3d2b027b1
7
+ data.tar.gz: 628f968c28e69f4061f42c7b55c5bff04aa16fc95f677f281454a704cfa50416f8174f474d7f8e94a0a4e0df6db67d40a3cb35c635ebd0ad641e9d6b77255bd6
data/lib/mavenlint.rb CHANGED
@@ -1 +1,2 @@
1
1
  require 'rubocop/cop/mavenlint/unsafe-mass-assignment'
2
+ require 'rubocop/cop/mavenlint/use-application-record'
@@ -0,0 +1,32 @@
1
+ require 'rubocop'
2
+
3
+ module RuboCop
4
+ module Cop
5
+ module Mavenlint
6
+ # Enforce models inheriting from ApplicationRecord instead of ActiveRecord::Base
7
+ #
8
+ # For example
9
+ #
10
+ # class SomeModel < ActiveRecord::Base
11
+ # end
12
+ #
13
+ # should be
14
+ #
15
+ # class SomeModel < ApplicationRecord
16
+ # end
17
+ #
18
+ # Note that this cop is built in to RuboCop. However, it only runs on Rails 5, and we want
19
+ # run it even though we're on Rails 4. Once we're on Rails 5, however, we should be able to
20
+ # remove this custom cop and enable the built-in one.
21
+ # @see https://github.com/bbatsov/rubocop/blob/10a7041d23bcd579821b378dd351aeead7c3f082/lib/rubocop/cop/rails/application_record.rb
22
+ #
23
+ class UseApplicationRecord < RuboCop::Cop::Cop
24
+ MSG = 'Models should subclass `ApplicationRecord`.'.freeze
25
+ SUPERCLASS = 'ApplicationRecord'.freeze
26
+ BASE_PATTERN = '(const (const nil? :ActiveRecord) :Base)'.freeze
27
+
28
+ include RuboCop::Cop::EnforceSuperclass
29
+ end
30
+ end
31
+ end
32
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mavenlint
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mavenlnk
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-26 00:00:00.000000000 Z
11
+ date: 2018-04-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -42,16 +42,16 @@ dependencies:
42
42
  name: rubocop
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: '0.49'
47
+ version: '0.51'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - '='
53
53
  - !ruby/object:Gem::Version
54
- version: '0.49'
54
+ version: '0.51'
55
55
  description:
56
56
  email:
57
57
  - ahuth@mavenlink.com
@@ -61,6 +61,7 @@ extra_rdoc_files: []
61
61
  files:
62
62
  - lib/mavenlint.rb
63
63
  - lib/rubocop/cop/mavenlint/unsafe-mass-assignment.rb
64
+ - lib/rubocop/cop/mavenlint/use-application-record.rb
64
65
  - rubocop.yml
65
66
  homepage: https://github.com/mavenlink/mavenlint
66
67
  licenses: