Giter Club home page Giter Club logo

commit-message-corrector's Introduction

Commit-Message-Corrector

commit convention 에 맞는 commit 메세지인 지를 판별하는 프로그램

What?

  1. Separate subject from body with a blank line
  2. Limit the subject line to 50 characters
  3. Capitalize the subject line
  4. Do not end the subject line with a period
  5. Have specified subject type or subject type in bracket
  6. Use the imperative mood in the subject line
    1. the verb is in the past tense or not
    2. the verb is the third person
  7. Wrap the body at 72 characters

Commit Convention

위의 convention 을 참조했으며 대표적인 opensorce commit message 형식을 참조했습니다.

commit-message-corrector's People

Contributors

jihoju avatar khj1030 avatar

Watchers

 avatar

commit-message-corrector's Issues

Check if commit message is too long

커밋 메세지 컨벤션을 기반으로

  • subject: around 50 characters or less
  • body: around 72 characters or less
    다음 글자 수를 넘으며 too long 이라 판단

Check if commit message subect is capitalized

Commit message subject 명령문의 경우 대문자로 시작하는 지 확인한다.

Case 1

commit convention에 맞는 type이 포함된 경우

ex) feat: add good Class, fix: fix bug, etc
commit type 이후에 동사가 소문자인 지를 확인

Case 2

어느 type (Convention 에 맞지 않는 경우도 포함)이 Bracket 으로 싸여져 있는 경우

ex) [DevTools] Add good things~, etc
Bracket 이후에 동사가 capitalized 확인

Case 3

위의 두 case 가 아닌 명령문인 경우

ex) Add good things~, Update README.md, etc
동사가 capitalized 확인

Check if commit message is imperative sentence

commit message 가 명령문 형식으로 쓰여져 있는 지 확인한다.

Case 1

  • Update README.md
  • Add PostPhotoView & EditPhotoView & delete_photo
  1. 첫 번째 token(word)가 동사인지를 확인
  2. 첫 번째 token(word)가 third (3인칭: runs, adds 등의 경우) 인 지를 판단
  3. 첫 번째 token(word)의 시제가 현재형, 과거형(added) 인지를 판단

Case 2: commit type 이 제대로 명시되어 있는 경우

  • docs: remove tf ckpt from huggingface hub
  • fix: correctly evaluate korquad
  1. commit type 이후 token(word) 가 동사인지를 확인
  2. commit type 이후 token(word) 가 부사인 경우 바로 뒤에 동사가 나오는 지 확인

Case 3: 어느 type 이 bracket 으로 감싸져있는 경우

  • [DevTools] Remove string.replaceAll Call in @reactVersion Pragma Func
  1. [word] 이후 token(word) 가 동사인지를 확인
  2. token(word)가 third (3인칭: runs, adds 등의 경우) 인 지를 판단
  3. token(word)의 시제가 현재형, 과거형(added) 인지를 판단

Check if commit type is included in commit message

커밋메시지가 commit type 으로 시작하는 지 확인

  • feat
  • fix
  • style
  • refactor
  • test
  • docs
  • chore
  • design
  • build
  • ci
  • style
  • test
  • rename
  • remove

좋은 예시

  • chores: sort in numerical order
  • fix: correctly evaluate korquad
  • feat: korean-hate-speech

[type] 으로 작성하는 경우 확인

예시

  • [DevTools] Remove string.replaceAll Call in @reactVersion Pragma Func…
  • [Refactor] Refactor correctly ~~

Create CommitMsgCorrector

사용자의 커밋메세지가 커밋메세지 컨벤션에 맞는지 아닌지를 판단해주는 객체 생성

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.