rubocop-discourse 2.5.0 → 3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3a1dd5d5b8d79de5bcda354a31c6f993460f11875065c64edd9f7cc3cce71bff
4
- data.tar.gz: 175c1f83d9300537bac93184d5e8bf5d21cffc8196e996d59cc9298f69d8bdb5
3
+ metadata.gz: caa33338c84c26b1d2bc6010ca26ab11bd265c96086def2d8e6591fe995b2660
4
+ data.tar.gz: f8a7c7e8b0153aeb4fb251155836cc8abdcd58c538d7a8ce42fda403a0489b4a
5
5
  SHA512:
6
- metadata.gz: ada5c637849f829f0d8d0247b86fbec1a1cc9182d06b6385f6ac13f081f9782a7d9cd38d8a3dd30c2bf121f834171a9f28933deaee4ab8a53a022aa3af5d06fc
7
- data.tar.gz: ab731fee843a5a8ef9821c613751906457672eb11bed54ec0aae3856588b723a77c03aa26f258a3c1e19c25b1edac4d198ae8ffbfd3e4bbaf397d4e2f1332c8f
6
+ metadata.gz: bd90fcbefb1c81bb199ef9546e32a62bb7d044853faaf5e9e5445e8d05f819c507e618ce0d546edb67da34d463e098e105580e81a0f48a085d3fbf395f0fa86b
7
+ data.tar.gz: c28eddf777f8ac0e00785a21c2ce0ef44891548dc4d00a37ca1ae63d10507db095ec7ac578e6f6eef959c2ac8c7f0a1976dd05a41913de5d6a9b36314d0c3f2c
data/default.yml CHANGED
@@ -1,21 +1,6 @@
1
- require:
2
- - rubocop-discourse
3
-
4
1
  inherit_from:
5
- - ./rubocop-core.yml
6
- - ./rubocop-rspec.yml
7
-
8
- AllCops:
9
- TargetRubyVersion: 2.6
10
- DisabledByDefault: true
11
- Exclude:
12
- - "db/schema.rb"
13
- - "bundle/**/*"
14
- - "vendor/**/*"
15
- - "**/node_modules/**/*"
16
- - "public/**/*"
17
- - "plugins/**/gems/**/*"
18
- - "plugins/**/vendor/**/*"
2
+ - ./stree-compat.yml
3
+ - ./rubocop-layout.yml
19
4
 
20
- Discourse:
21
- Enabled: true
5
+ Layout/LineLength:
6
+ Enabled: false
data/rubocop-core.yml CHANGED
@@ -38,83 +38,6 @@ Style/GlobalVars:
38
38
  - 'spec/**/*.rb'
39
39
  - 'plugins/*/spec/**/*'
40
40
 
41
- # Align `when` with `case`.
42
- Layout/CaseIndentation:
43
- Enabled: true
44
-
45
- # Align comments with method definitions.
46
- Layout/CommentIndentation:
47
- Enabled: true
48
-
49
- # No extra empty lines.
50
- Layout/EmptyLines:
51
- Enabled: true
52
-
53
- # Two spaces, no tabs (for indentation).
54
- Layout/IndentationWidth:
55
- Enabled: true
56
-
57
- Layout/SpaceAfterColon:
58
- Enabled: true
59
-
60
- Layout/SpaceAfterComma:
61
- Enabled: true
62
-
63
- Layout/SpaceAroundEqualsInParameterDefault:
64
- Enabled: true
65
-
66
- Layout/SpaceAroundKeyword:
67
- Enabled: true
68
-
69
- Layout/SpaceAroundOperators:
70
- Enabled: true
71
-
72
- Layout/SpaceBeforeFirstArg:
73
- Enabled: true
74
-
75
- # Use `foo {}` not `foo{}`.
76
- Layout/SpaceBeforeBlockBraces:
77
- Enabled: true
78
-
79
- # Use `foo { bar }` not `foo {bar}`.
80
- Layout/SpaceInsideBlockBraces:
81
- Enabled: true
82
-
83
- # Use `{ a: 1 }` not `{a:1}`.
84
- Layout/SpaceInsideHashLiteralBraces:
85
- Enabled: true
86
-
87
- Layout/SpaceInsideParens:
88
- Enabled: true
89
-
90
- # Detect hard tabs, no hard tabs.
91
- Layout/IndentationStyle:
92
- Enabled: true
93
-
94
- # Blank lines should not have any spaces.
95
- Layout/TrailingEmptyLines:
96
- Enabled: true
97
-
98
- # No trailing whitespace.
99
- Layout/TrailingWhitespace:
100
- Enabled: true
101
-
102
- Layout/BlockAlignment:
103
- Enabled: true
104
-
105
- # Align `end` with the matching keyword or starting expression except for
106
- # assignments, where it should be aligned with the LHS.
107
- Layout/EndAlignment:
108
- Enabled: true
109
- EnforcedStyleAlignWith: variable
110
-
111
- Layout/MultilineMethodCallIndentation:
112
- Enabled: true
113
- EnforcedStyle: indented
114
-
115
- Layout/HashAlignment:
116
- Enabled: true
117
-
118
41
  Lint/Debugger:
119
42
  Enabled: true
120
43
 
@@ -127,3 +50,10 @@ Lint/ShadowingOuterLocalVariable:
127
50
 
128
51
  Bundler/OrderedGems:
129
52
  Enabled: false
53
+
54
+ # Enable Layout/LineLength because certain cops that most projects use
55
+ # (e.g. Style/IfUnlessModifier) require Layout/LineLength to be enabled.
56
+ # By leaving it disabled, those rules will mis-fire.
57
+ Layout/LineLength:
58
+ Enabled: true
59
+ Max: 240
@@ -2,9 +2,9 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "rubocop-discourse"
5
- s.version = "2.5.0"
5
+ s.version = "3.0"
6
6
  s.summary = "Custom rubocop cops used by Discourse"
7
- s.authors = ["David Taylor"]
7
+ s.authors = ["Discourse Team"]
8
8
  s.license = "MIT"
9
9
  s.homepage = "https://github.com/discourse/rubocop-discourse"
10
10
 
@@ -0,0 +1,76 @@
1
+ # Align `when` with `case`.
2
+ Layout/CaseIndentation:
3
+ Enabled: true
4
+
5
+ # Align comments with method definitions.
6
+ Layout/CommentIndentation:
7
+ Enabled: true
8
+
9
+ # No extra empty lines.
10
+ Layout/EmptyLines:
11
+ Enabled: true
12
+
13
+ # Two spaces, no tabs (for indentation).
14
+ Layout/IndentationWidth:
15
+ Enabled: true
16
+
17
+ Layout/SpaceAfterColon:
18
+ Enabled: true
19
+
20
+ Layout/SpaceAfterComma:
21
+ Enabled: true
22
+
23
+ Layout/SpaceAroundEqualsInParameterDefault:
24
+ Enabled: true
25
+
26
+ Layout/SpaceAroundKeyword:
27
+ Enabled: true
28
+
29
+ Layout/SpaceAroundOperators:
30
+ Enabled: true
31
+
32
+ Layout/SpaceBeforeFirstArg:
33
+ Enabled: true
34
+
35
+ # Use `foo {}` not `foo{}`.
36
+ Layout/SpaceBeforeBlockBraces:
37
+ Enabled: true
38
+
39
+ # Use `foo { bar }` not `foo {bar}`.
40
+ Layout/SpaceInsideBlockBraces:
41
+ Enabled: true
42
+
43
+ # Use `{ a: 1 }` not `{a:1}`.
44
+ Layout/SpaceInsideHashLiteralBraces:
45
+ Enabled: true
46
+
47
+ Layout/SpaceInsideParens:
48
+ Enabled: true
49
+
50
+ # Detect hard tabs, no hard tabs.
51
+ Layout/IndentationStyle:
52
+ Enabled: true
53
+
54
+ # Blank lines should not have any spaces.
55
+ Layout/TrailingEmptyLines:
56
+ Enabled: true
57
+
58
+ # No trailing whitespace.
59
+ Layout/TrailingWhitespace:
60
+ Enabled: true
61
+
62
+ Layout/BlockAlignment:
63
+ Enabled: true
64
+
65
+ # Align `end` with the matching keyword or starting expression except for
66
+ # assignments, where it should be aligned with the LHS.
67
+ Layout/EndAlignment:
68
+ Enabled: true
69
+ EnforcedStyleAlignWith: variable
70
+
71
+ Layout/MultilineMethodCallIndentation:
72
+ Enabled: true
73
+ EnforcedStyle: indented
74
+
75
+ Layout/HashAlignment:
76
+ Enabled: true
data/rubocop-rspec.yml CHANGED
@@ -8,16 +8,40 @@ RSpec/AroundBlock:
8
8
  Enabled: true
9
9
 
10
10
  RSpec/BeforeAfterAll:
11
- Enabled: false # To be decided
11
+ Enabled: true
12
+
13
+ RSpec/ChangeByZero:
14
+ Enabled: true
12
15
 
13
16
  RSpec/ContextMethod:
14
- Enabled: false # TODO
17
+ Enabled: true
15
18
 
16
19
  RSpec/ContextWording:
17
- Enabled: false # To be decided
20
+ Enabled: true
21
+ Prefixes:
22
+ - when
23
+ - with
24
+ - without
25
+ - for
26
+ - while
27
+ - if
28
+ - as
29
+ - after
18
30
 
19
31
  RSpec/DescribeClass:
20
- Enabled: false # To be decided
32
+ Enabled: true
33
+ Exclude:
34
+ - "**/spec/features/**/*"
35
+ - "**/spec/requests/**/*"
36
+ - "**/spec/routing/**/*"
37
+ - "**/spec/system/**/*"
38
+ - "**/spec/views/**/*"
39
+ - "**/spec/initializers/**/*"
40
+ - "**/spec/integration/**/*"
41
+ - "**/spec/integrity/**/*"
42
+ - "**/spec/tasks/**/*"
43
+ - "**/spec/lib/freedom_patches/**/*"
44
+ - "**/spec/multisite/**/*"
21
45
 
22
46
  RSpec/DescribeMethod:
23
47
  Enabled: true
data/stree-compat.yml ADDED
@@ -0,0 +1,21 @@
1
+ require:
2
+ - rubocop-discourse
3
+
4
+ inherit_from:
5
+ - ./rubocop-core.yml
6
+ - ./rubocop-rspec.yml
7
+
8
+ AllCops:
9
+ TargetRubyVersion: 2.6
10
+ DisabledByDefault: true
11
+ Exclude:
12
+ - "db/schema.rb"
13
+ - "bundle/**/*"
14
+ - "vendor/**/*"
15
+ - "**/node_modules/**/*"
16
+ - "public/**/*"
17
+ - "plugins/**/gems/**/*"
18
+ - "plugins/**/vendor/**/*"
19
+
20
+ Discourse:
21
+ Enabled: true
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-discourse
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.0
4
+ version: '3.0'
5
5
  platform: ruby
6
6
  authors:
7
- - David Taylor
7
+ - Discourse Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-01 00:00:00.000000000 Z
11
+ date: 2022-09-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
@@ -99,6 +99,7 @@ files:
99
99
  - lib/rubocop/discourse/inject.rb
100
100
  - rubocop-core.yml
101
101
  - rubocop-discourse.gemspec
102
+ - rubocop-layout.yml
102
103
  - rubocop-rspec.yml
103
104
  - spec/lib/rubocop/cop/no_add_reference_active_record_migrations_spec.rb
104
105
  - spec/lib/rubocop/cop/no_mixing_multisite_and_standard_specs_spec.rb
@@ -106,6 +107,7 @@ files:
106
107
  - spec/lib/rubocop/cop/no_reset_column_information_migrations_spec.rb
107
108
  - spec/lib/rubocop/cop/only_top_level_multisite_specs_spec.rb
108
109
  - spec/spec_helper.rb
110
+ - stree-compat.yml
109
111
  homepage: https://github.com/discourse/rubocop-discourse
110
112
  licenses:
111
113
  - MIT