Skip to content

Commit c40ff74

Browse files
committed
ステップ6にて導入するrubocopの設定としてelcopを選べるようにした
1 parent 93c0918 commit c40ff74

File tree

5 files changed

+180
-1
lines changed

5 files changed

+180
-1
lines changed

docs/el-training.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,9 @@
148148
- GitHub上でPRを作成してレビューしてもらいましょう
149149

150150
### ステップ6: RuboCop を設定しよう
151-
152151
- Linter・Formatter として RuboCop を設定しましょう
153152
- 社内で広く使われている RuboCop の設定があれば、それを利用するか検討しましょう
153+
- 本研修カリキュラムのおすすめの設定を使っていただくこともできます。利用方法については [/rubocop ディレクトリ内のREADME](../rubocop/README.md)を参照してください。
154154
- (サポーターに依頼)PR作成時に RuboCop が実行されるように、Circle CI を設定してもらいましょう
155155
- CIの初期設定はカリキュラムで学んで欲しい項目からやや外れているため、サポーターがCIを設定するようにしてください
156156
- 以降、コーディング規約はサポーター・レビュワーと相談しながら必要に応じて更新していきましょう

rubocop/.elcop-rspec.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# RuboCop 万葉標準設定(RSpec)
2+
# - 各Copごとの設定は、グループ別に、アルファベット順に記述してください。
3+
#
4+
# Copyright 株式会社万葉
5+
6+
require:
7+
- rubocop-rspec
8+
9+
RSpec/ContextWording:
10+
Enabled: false
11+
RSpec/ExampleLength:
12+
Enabled: false
13+
RSpec/InstanceVariable:
14+
Exclude:
15+
- 'spec/views/**/*'
16+
RSpec/MultipleExpectations:
17+
Enabled: false
18+
RSpec/MultipleMemoizedHelpers:
19+
Enabled: false
20+
RSpec/NestedGroups:
21+
Max: 5
22+
RSpec/ScatteredSetup:
23+
Enabled: false

rubocop/.elcop.yml

+142
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
# RuboCop 万葉標準設定(Railsアプリ用)
2+
# - 各Copごとの設定は、グループ別に、アルファベット順に記述してください。
3+
#
4+
# Copyright 株式会社万葉
5+
6+
require:
7+
- rubocop-rails
8+
9+
AllCops:
10+
NewCops: enable
11+
Exclude: # 自動生成ファイルを除外する
12+
- 'Gemfile'
13+
- 'bin/*'
14+
- 'db/schema.rb'
15+
- 'config/puma.rb'
16+
- 'Rakefile'
17+
- 'vendor/**/*'
18+
19+
Layout/AccessModifierIndentation:
20+
Enabled: false
21+
Layout/BeginEndAlignment:
22+
Enabled: false
23+
Layout/DotPosition:
24+
Enabled: false
25+
Layout/EndAlignment:
26+
Enabled: false
27+
Layout/ExtraSpacing:
28+
Exclude:
29+
- 'db/migrate/**/*'
30+
Layout/HashAlignment:
31+
Enabled: false
32+
Layout/LineContinuationLeadingSpace:
33+
Enabled: false
34+
Layout/LineLength:
35+
Max: 160
36+
Layout/SpaceBeforeFirstArg:
37+
Exclude:
38+
- 'db/migrate/**/*'
39+
Metrics/AbcSize:
40+
Enabled: false
41+
Metrics/BlockLength:
42+
Enabled: false
43+
Metrics/BlockNesting:
44+
Enabled: false
45+
Metrics/ClassLength:
46+
Enabled: false
47+
Metrics/CyclomaticComplexity:
48+
Enabled: false
49+
Metrics/MethodLength:
50+
Enabled: false
51+
Metrics/ModuleLength:
52+
Enabled: false
53+
Metrics/ParameterLists:
54+
Max: 7
55+
MaxOptionalParameters: 7
56+
Metrics/PerceivedComplexity:
57+
Enabled: false
58+
59+
Naming/AccessorMethodName:
60+
Exclude:
61+
- 'app/controllers/**/*'
62+
Naming/PredicateName:
63+
NamePrefix:
64+
- is_
65+
ForbiddenPrefixes:
66+
- is_
67+
Style/GuardClause:
68+
Enabled: false
69+
Style/BlockDelimiters:
70+
Enabled: false
71+
Style/ClassAndModuleChildren:
72+
Enabled: false
73+
Style/ConditionalAssignment:
74+
Enabled: false
75+
Style/DoubleNegation:
76+
Enabled: false
77+
Style/Documentation:
78+
Enabled: false
79+
Style/EmptyElse:
80+
Enabled: false
81+
Style/EmptyMethod:
82+
Enabled: false
83+
Style/FetchEnvVar:
84+
Enabled: false
85+
Style/FrozenStringLiteralComment:
86+
Enabled: false
87+
Style/GlobalStdStream:
88+
Enabled: false
89+
Style/HashLikeCase:
90+
Enabled: false
91+
Style/HashSyntax:
92+
EnforcedShorthandSyntax: either
93+
Style/IfInsideElse:
94+
Enabled: false
95+
Style/IfUnlessModifier:
96+
Enabled: false
97+
Style/Lambda:
98+
Enabled: false
99+
Style/NegatedIf:
100+
Enabled: false
101+
Style/NumericPredicate:
102+
Enabled: false
103+
Style/OptionalBooleanParameter:
104+
Enabled: false
105+
Style/QuotedSymbols:
106+
Enabled: false
107+
Style/StringLiterals:
108+
Enabled: false
109+
Style/StringLiteralsInInterpolation:
110+
Enabled: false
111+
Style/SymbolArray:
112+
Enabled: false
113+
Style/TrailingCommaInArguments:
114+
Enabled: false
115+
Style/TrailingCommaInArrayLiteral:
116+
Enabled: false
117+
Style/TrailingCommaInHashLiteral:
118+
Enabled: false
119+
Style/ZeroLengthPredicate:
120+
Enabled: false
121+
Style/WordArray:
122+
Enabled: false
123+
124+
# rubocop-rails
125+
Rails/ActiveRecordCallbacksOrder:
126+
Enabled: false
127+
Rails/Blank:
128+
UnlessPresent: false
129+
Rails/BulkChangeTable:
130+
Enabled: false
131+
Rails/Delegate:
132+
Enabled: false
133+
Rails/I18nLocaleTexts:
134+
Enabled: false
135+
Rails/LexicallyScopedActionFilter:
136+
Enabled: false
137+
Rails/NotNullColumn:
138+
Enabled: false
139+
Rails/SkipsModelValidations:
140+
Enabled: false
141+
Rails/WhereExists:
142+
Enabled: false

rubocop/.rubocop.yml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
inherit_from:
2+
- ./.elcop.yml
3+
- ./.elcop-rspec.yml

rubocop/README.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
## 本研修カリキュラムのおすすめRuboCop設定の利用方法
2+
[RuboCop](https://github.com/rubocop/rubocop)を導入して、
3+
以下の3つのファイルを、アプリケーションのルートディレクトリ内にコピーしてください。
4+
5+
- .rubocop.yml
6+
- .elcop.yml
7+
- .elcop-rspec.yml
8+
9+
ご自分で設定をカスタマイズされる場合は、.rubocop.yml に記述します。
10+
.elcop.yml と .elcop-rspec.yml は、本研修カリキュラムの一部として更新される場合があります。
11+
必要に応じて新しいバージョンに置き換えてご利用ください。

0 commit comments

Comments
 (0)