Welcome to mirror list, hosted at ThFree Co, Russian Federation.

rubocop.yml « config « gems - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: ca46e30e2cd8b030421f9a757c0677710a75c33a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# We need to ignore exclusions defined in parent RuboCop configuration
# (AllCops/Exclude: 'gems/**/*') if RuboCop cop is run within `gems/...`.
# See https://gitlab.com/gitlab-org/gitlab/-/issues/417281
<%
  relative_path = ENV['PWD'].delete_prefix(File.expand_path('../..'))
  RuboCop::ConfigLoader.ignore_parent_exclusion = relative_path.start_with?('/gems/')
%>
---
inherit_gem:
  gitlab-styles:
    - rubocop-default.yml

require:
  - ../../rubocop/rubocop
  - rubocop-rspec

inherit_mode:
  merge:
    - Include
    - Exclude
    - AllowedPatterns

AllCops:
  # Target the current Ruby version. For example, "3.0" or "3.1".
  TargetRubyVersion: <%= RUBY_VERSION[/^\d+\.\d+/, 0] %>
  SuggestExtensions: false
  NewCops: disable

# This cop doesn't make sense in the context of gems
CodeReuse/ActiveRecord:
  Enabled: false

# This cop doesn't make sense in the context of gems
Cop/PutGroupRoutesUnderScope:
  Enabled: false

# This cop doesn't make sense in the context of gems
Cop/PutProjectRoutesUnderScope:
  Enabled: false

Gemspec/AvoidExecutingGit:
  Enabled: true

# We disable this since we support multiple Ruby versions
Gemspec/RequiredRubyVersion:
  Enabled: false

# This cop doesn't make sense in the context of gems
Gitlab/DocUrl:
  Enabled: false

# This cop doesn't make sense in the context of gems
Gitlab/NamespacedClass:
  Enabled: false

# This cop doesn't make sense in the context of gems
Gitlab/RSpec/AvoidSetup:
  Enabled: false

# This cop doesn't make sense in the context of gems
Graphql/AuthorizeTypes:
  Enabled: false

Gitlab/Json:
  Enabled: false

# This cop doesn't make sense in the context of gems
Graphql/Descriptions:
  Enabled: false

# This cop doesn't make sense in the context of gems
RSpec/BeforeAll:
  Enabled: false

Naming/FileName:
  Exclude:
    - spec/**/*.rb

# This cop doesn't make sense in the context of gems
RSpec/AvoidConditionalStatements:
  Enabled: false

RSpec/ContextWording:
  Prefixes:
  - 'when'
  - 'with'
  - 'without'
  - 'for'
  - 'and'
  - 'on'
  - 'in'
  - 'as'
  - 'if'

# This cop doesn't make sense in the context of gems
RSpec/FeatureCategory:
  Enabled: false

# Enable once we drop 3.0 support
Style/HashSyntax:
  Enabled: false

Style/InlineDisableAnnotation:
  Enabled: false

Style/Lambda:
  EnforcedStyle: literal

Style/RegexpLiteralMixedPreserve:
  Enabled: true
  SupportedStyles:
    - slashes
    - percent_r
    - mixed
    - mixed_preserve
  EnforcedStyle: mixed_preserve