Skip to content

Commit 8e92f7e

Browse files
poozaclaude
andcommitted
style: Layout/EndAlignment設定追加とインデントスタイル統一
位置揃えインデントを排除し、常に論理的な2スペースインデントに統一。 MastodonControllerのcase式代入を分岐内個別代入に書き換え。 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 0a51a57 commit 8e92f7e

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

.rubocop.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ Layout/ArrayAlignment:
2727
EnforcedStyle: with_fixed_indentation
2828
Layout/EmptyLineAfterGuardClause:
2929
Enabled: false
30+
Layout/EndAlignment:
31+
EnforcedStyleAlignWith: variable
3032
Layout/EndOfLine:
3133
EnforcedStyle: lf
3234
Layout/FirstArgumentIndentation:
@@ -125,6 +127,8 @@ Sequel:
125127
- app/migration/**/*.rb
126128
Sequel/ConcurrentIndex:
127129
Enabled: false
130+
Sequel/IrreversibleMigration:
131+
Enabled: false
128132
Style/AsciiComments:
129133
Enabled: false
130134
Style/ConditionalAssignment:

app/lib/mulukhiya/controller/mastodon_controller.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,15 @@ class MastodonController < Controller
5757
put '/api/:version/statuses/:id' do
5858
verify_token_integrity!
5959
purpose = request.env['HTTP_X_MULUKHIYA_PURPOSE']
60-
body = case purpose
61-
when nil, '', 'media_update'
62-
source = sns.fetch_status_source(params[:id], {headers: @headers})
63-
{status: source['text'], media_attributes: params[:media_attributes]}.compact
64-
when 'tag'
65-
{status: params[:status], media_attributes: params[:media_attributes]}.compact
66-
else
67-
raise Ginseng::ValidateError, "unknown purpose: #{purpose}"
68-
end
60+
case purpose
61+
when nil, '', 'media_update'
62+
source = sns.fetch_status_source(params[:id], {headers: @headers})
63+
body = {status: source['text'], media_attributes: params[:media_attributes]}.compact
64+
when 'tag'
65+
body = {status: params[:status], media_attributes: params[:media_attributes]}.compact
66+
else
67+
raise Ginseng::ValidateError, "unknown purpose: #{purpose}"
68+
end
6969
raise Ginseng::ValidateError, 'media_attributes is required' if body.empty?
7070
reporter.response = sns.update_status(params[:id], body, {headers: @headers})
7171
@renderer.message = reporter.response.parsed_response

docs/CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,7 @@ CIでは `config/local.yaml` に `controller: mastodon|misskey` のみ設定さ
532532
以下はユーザーから都度指示される。指示があり次第ここに追記する。
533533

534534
- メソッド末尾でも `return` を省略しない(暗黙のreturnを使わない)
535+
- インデントは常に2スペース。見栄えのための位置揃え(代入の右辺にcase/if式を置いて深くインデントする等)は使わない。`x = case ...` ではなく、各分岐内で個別に代入する
535536

536537
### ドキュメント表記規約
537538

0 commit comments

Comments
 (0)