0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Cursorでコミットメッセージの書き方を指定する

Posted at

概要

.cursorrules ファイル内にルールを記述することでフォーマットを指定できる。

背景

Cursorが自動生成するGitのコミットメッセージが日本語で冗長になりがちだったので、 User RulesProject Rules に英語で書くよう指示を加えたが反映されなかった。

解決策

.cursorrules ファイルを作成し、次のようにプロンプトを記述した。

.cursorrules
## Git Commit Messages
When generating git commit messages:
- **ALWAYS begin with a verb** (Add, Fix, Update, Change, Docs, Style, Refactor, ...)
- Keep the message under 50 characters
- Use imperative mood
- Be specific but concise
- No periods at the end
- **Language**: Always use English for commit messages

Chat Settings -> Rules & Memories -> Project Rules 内の Include .cursorrules file を有効化するのを忘れずに。

{4E650748-6046-4277-95CA-AE7392E7F96D}.png

補足

.cursorrules によるルール付けは公式には非推奨とのこと。
今後のアップデートで対応される可能性もありそう。

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?