不具合の説明や修正コミットから必要事項を整理し、再現手順や期待・実際の動作を含むバグチケットをLPDプロジェクトのJiraに登録できます。
- LPDの不具合をJiraに登録したいとき
- 修正コミットからバグを起票したいとき
- 再現手順と期待動作を整理したいとき
Liferayのソースコードを対象に、対応する整形ツールとルールを使って形式をそろえ、生成ファイルを避けながら修正対象を確認できます。
Format source files to align with Liferay's coding standards.
実行スコア 未検証
インストール方法を見るLiferayのソースファイルをプロジェクトの規約に沿って整形する手順を案内します。対象モジュールではformatSourceを実行し、コードベース全体ではコミット済みファイルを対象にformat-source-current-branchを使う方法を示します。GoファイルにはgofmtとGo向け規約を適用し、シェルスクリプトは別のformat-bash-sourceガイドに従います。フォーマッターが問題を示した場合は修正し、生成ファイルは編集対象から外します。生成物の判別に使うマーカーや、Goのzz_generatedを含むファイルも説明されています。
モジュールの変更後にコードの書式を整えたいときや、コミットした変更の整形漏れを確認したいときに使えます。Goやシェルなど、通常のソースフォーマッターとは異なるルールがあるファイルを扱う場合にも役立ちます。
シェルスクリプトではliferay-dockerのformat-bash-sourceとCODE_STYLE.mdを参照します。Goでは.claude/rules/go-style.mdを参照します。全体向けコマンドはコミット済みファイルだけを調べるため、コミット後に実行します。生成ファイルは次回のビルドなどで上書きされるため、編集しません。
この紹介文は、公開されている SKILL.md をもとに AI(OpenAI Codex)が作成しました。正確な仕様は下の原文を確認してください。
インストールする前に、エージェントに与えられる指示の中身を確認できます。
All the code is strictly formatted using the source formatter (Java, JavaScript, JSON, JSP, Markdown, properties, shell, XML, YAML, and others). This is how it works:
Run for a specific module:
cd <module-root> && <gradlew> formatSource
Run across the entire codebase:
git fetch --no-tags https://github.com/brianchandotcom/liferay-portal.git master
cd <repo-root>/portal-impl && ANT_OPTS="-Xmx2560m -Dgit.working.branch.name=$(git merge-base HEAD FETCH_HEAD)" ant format-source-current-branch
Pass git.working.branch.name in ANT_OPTS rather than on the command line, since the yarn formatter lists its files through a separate ant git-util call that inherits nothing else. When the fetch fails, leave out -Dgit.working.branch.name.
ant format-source-current-branch only inspects committed files, so run it after creating the commit, and amend any formatter changes or fixes into that commit.
In both cases, if there are issues to be fixed, the formatter will list them. Fix them.
Skip generated files. The automatic formatter already does this via BaseSourceProcessor.hasGeneratedTag; apply the same rule to any manual edit. A file is generated when it contains any of these unquoted markers:
@generated — Service Builder, REST Builder, taglib generator (Java, by far the most common; ~18k files)
$ANTLR — ANTLR-generated lexers and parsers
# This is a generated file. — generated scripts
## Autogenerated — generated Markdown and config
// Code generated ... DO NOT EDIT. — go generate output, such as the controller-gen deepcopy and kubebuilder scaffolding under cloud/
These files are overwritten on the next build, so manual edits are lost and only pollute the diff.
Shell scripts (*.sh) follow a separate style guide maintained in the liferay-docker repository. Defer their formatting to the format-bash-source skill and the CODE_STYLE.md it depends on. Resolve both files in this order:
Local Checkout — when liferay-docker sits beside this repository, read ../liferay-docker/.claude/skills/format-bash-source/SKILL.md and ../liferay-docker/.claude/CODE_STYLE.md.
Remote Fallback — when the local checkout is absent, download both files from raw.githubusercontent.com and read them from there:
temp_dir=$(mktemp -d)
curl \
--fail \
--output "${temp_dir}/format-bash-source.md" \
--silent \
--url "https://raw.githubusercontent.com/liferay/liferay-docker/refs/heads/master/.claude/skills/format-bash-source/SKILL.md"
curl \
--fail \
--output "${temp_dir}/CODE_STYLE.md" \
--silent \
--url "https://raw.githubusercontent.com/liferay/liferay-docker/refs/heads/master/.claude/CODE_STYLE.md"
For any *.sh file in scope, read the resolved format-bash-source SKILL.md and the CODE_STYLE.md it points to, then apply those rules.
Go files (*.go) are outside the portal source formatter's set of file types, so the automatic formatter gofmt is used instead. The conventions for Go live in .claude/rules/go-style.md, which is scoped to cloud/operator/**/*.go. Read that file and apply it.
The workflow mirrors the one above. Run gofmt across the Go module — the directory that holds go.mod — apply the rules from .claude/rules/go-style.md, then rerun gofmt to absorb any changes. Both the first pass and the rerun are the same command:
cd <go-module-root> && gofmt -w .
List the files that are not yet formatted without rewriting them:
cd <go-module-root> && gofmt -l .
When a rule and gofmt disagree, gofmt wins; leave the formatted code as it stands.
Skip generated Go files. Beyond the marker line listed above, a Go file whose name contains zz_generated is generated output that the next go generate rewrites.
まだレビューはありません。使ってみた感想をお寄せください。
ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。
まだコメントはありません。最初のコメントを書いてみませんか。
不具合の説明や修正コミットから必要事項を整理し、再現手順や期待・実際の動作を含むバグチケットをLPDプロジェクトのJiraに登録できます。
説明やコミット内容をもとに、必要な情報を整えてLPDプロジェクトのJiraにタスクを登録し、チケット番号と閲覧URLを受け取れます。
Liferay向けのMarkdown文書を、前付けの順序や見出しの表記、シェル記法、文章の調子まで整え、リポジトリの規約に沿った読みやすい形に仕上げます。
LiferayのPoshi `.testcase` を内容に応じてPlaywright、Jest、JUnit、Java統合テストへ移行し、既存テストとの重複や移行を妨げる条件も整理します。
LiferayコンポーネントのPoshiテストを調べ、重複するテストを統合・整理する計画を立ててから、確認しやすい単位でテスト数を減らします。
現在のブランチからGitHubのPRを作成し、関連するJiraチケットをレビュー状態に移してPRのURLを記録する手順を進めます。