LoginSignup
77
46

More than 5 years have passed since last update.

Githubの便利な機能であるSemantic Pull Requestを解説します

Last updated at Posted at 2018-11-09

この記事の内容を一言で

commitのメッセージやPull Requestの内容がひと目で内容がわかるように、メッセージ冒頭に(GitHubが用意した)慣例的なキーワードをつけてください。

はじめに

Githubをより便利に使えるツールを調べていたら、semantic-pull-requestsという機能を見つけた。
見てみるとなかなか便利だったため、どのようなものかを解説。

semantic-pull-requestって何?

まず、これがどういう機能かについて。
簡単に言えば、commitのメッセージとPull Requestにおけるタイトルのつけ方をチェックしてくれるもの。

semantic-pull-requestsのページのスクリーンショットを使いながら、具体的にどんな感じか解説。

semantic-pull-requestの機能

付け直したほうが良いメッセージ、タイトル ▶ 黄色

赤丸で囲ったPull Requestのタイトルに注目とSemantic Pull Requestに注目。


「別に普通でしょ?」って思った人もいると思う。
だが、Semantic Pull Requestのチェックによると、
Pending - add sementic commit or PR title
つまり、直してほしいとのこと。

「じゃあ、どういう風にメッセージやタイトルをつければ良いのさ」
その答えが次。

効果的なメッセージ、タイトル ▶ 緑色


「いや、feat:付けただけやん」

そう。
それがSemantic Pull Request

ひと目で内容がわかるように、冒頭にキーワードをつけてください。

ってだけ。

タイトルだけじゃなくて、どういう作業をしたかがわかる単語があれば、検索のときにも便利。
Serch欄にfeat:だけ打てば、開発に関係するPullRequestだけが表示されるからね。

使い方

上でも説明したように、commitのメッセージやPull Requestのタイトルに、作業内容を意味するキーワード:をつければいいだけ。

どんなキーワードがあるの?

以下はGithubにあったキーワードの一覧に日本語解説を加えたもの。

index.json
 { 
   "types": { 
     "feat": { 
       "description": "A new feature", 
       "title": "Features" 
       "日本語":"開発"
     }, 
     "fix": { 
       "description": "A bug fix", 
       "title": "Bug Fixes" 
       "日本語":"修正"
     }, 
     "docs": { 
       "description": "Documentation only changes", 
       "title": "Documentation" 
       "日本語":"文書の変更"
     }, 
     "style": { 
       "description": "Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)", 
       "title": "Styles" 
       "日本語": "Styleの修正"
     }, 
     "refactor": { 
       "description": "A code change that neither fixes a bug nor adds a feature", 
       "title": "Code Refactoring" 
       "日本語": "エラーが起きない範囲でより良いコードに変更"
     }, 
     "perf": { 
       "description": "A code change that improves performance", 
       "title": "Performance Improvements" 
       "日本語": "パフォーマンスの改善"
     }, 
     "test": { 
       "description": "Adding missing tests or correcting existing tests", 
       "title": "Tests" 
       "日本語": "テストの改善"
     }, 
     "build": { 
       "description": "Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)", 
       "title": "Builds" 
       "日本語": "npmといった外部に依存しているシステムの変更"
     }, 
     "ci": { 
       "description": "Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)", 
       "title": "Continuous Integrations" 
       "日本語": "npmといった外部に依存しているシステムの変更"
     }, 
     "chore": { 
       "description": "Other changes that don't modify src or test files", 
       "title": "Chores" 
       "日本語": "srcやテストに関連するファイルなど製品に関与しないモノの変更"
     }, 
     "revert": { 
       "description": "Reverts a previous commit", 
       "title": "Reverts" 
       "日本語": "前の状態に戻す"
     }
   } 
 } 

インストール

インストールはこちらから ▶ Semantic Pull Requests

おわりに

Githubだけでもメチャクチャ便利だが、自分がいま使用している以上に機能がある。
今後も調べてみよう。

77
46
2

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
77
46