Skip to content

Commit a172192

Browse files
committed
🎉 Support ActiveAdmin 2.x and code style improvements
- Add support ActiveAdmin for 2.x - Add rubocop config - Add frozen_string_literal to ruby files - Apply changes to respect rubocop alerts
1 parent 86c2cef commit a172192

File tree

8 files changed

+224
-126
lines changed

8 files changed

+224
-126
lines changed

.rubocop.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
require:
2+
- rubocop-rspec
3+
4+
Rails:
5+
Enabled: true
6+
7+
AllCops:
8+
TargetRubyVersion: 2.3.8
9+
TargetRailsVersion: 5.2
10+
Exclude:
11+
- db/schema.rb
12+
- bin/*
13+
- node_modules/**/*
14+
# Temporary files
15+
- tmp/**/*
16+
17+
Rails/InverseOf:
18+
Enabled: false
19+
20+
Style/Documentation:
21+
Enabled: false
22+
23+
Metrics/ClassLength:
24+
# Default value is 100
25+
Max: 150
26+
27+
Metrics/LineLength:
28+
# Default is 80
29+
Max: 120
30+
31+
Metrics/ModuleLength:
32+
# Default is 100
33+
Max: 150
34+
35+
Metrics/ParameterLists:
36+
# Default is 5
37+
Max: 6
38+
39+
RSpec/ExampleLength:
40+
# Default is 10
41+
Max: 20
42+
43+
Style/FrozenStringLiteralComment:
44+
# Deface DOES edit strings in place
45+
Exclude:
46+
- 'app/overrides/**/*'
47+
48+
RSpec/MultipleExpectations:
49+
# Default is 3
50+
Max: 5
51+
52+
RSpec/NestedGroups:
53+
# Default is 3
54+
Max: 6
55+
56+
Metrics/AbcSize:
57+
Max: 25
58+
59+
Metrics/BlockLength:
60+
# This value double the rubocop default
61+
Max: 50
62+
63+
Metrics/CyclomaticComplexity:
64+
# This value double the rubocop default
65+
Max: 12
66+
67+
Metrics/MethodLength:
68+
# This value double the rubocop default
69+
Max: 20
70+
71+
Metrics/PerceivedComplexity:
72+
# Default is 7
73+
Max: 10

Rakefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
# encoding: utf-8
1+
# frozen_string_literal: true
22

3-
require "bundler/gem_tasks"
3+
require 'bundler/gem_tasks'

activeadmin_dynamic_fields.gemspec

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
lib = File.expand_path('../lib', __FILE__)
1+
# frozen_string_literal: true
2+
3+
lib = File.expand_path('lib', __dir__)
24
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
35
require 'activeadmin/dynamic_fields/version'
46

0 commit comments

Comments
 (0)