Dev
Engineering Practices

Practices

Some engineering practices.

Conventional Commits

A convention on top of commit messages, conforms with SemVer.

Why use conventional commits?

  • communicate and document changes better (easier to read and track).
  • a more structured commit history, helping others to contribute easier.
  • directs us to commit by scope (a commit for a specific problem)
  • helps to generate automatic changelog when using standard-version.
<type>[optional scope]: <description>

# example
feat(pages): add home page
type
featadds a new feature which brings changes
fixbug fix

If you are using VSCode (opens in a new tab), you can use this extension (opens in a new tab) to help you compose conventional commit messages.

read more:

Conventional Comments

Code reviews can be better if we understand that the code we are reviewing are written by human and our review are also gonna be read by human. Sometimes we don't realize if our comments are unhelpful. This can be improved by following Conventional Comments (opens in a new tab), a convention which are inspired by Conventional Commits (opens in a new tab) and Google Engineering Practices (opens in a new tab).

example of unhelpful comments:

It's not worded correctly

by giving a label prefix:

suggestion: It's not worded correctly

how about other_word instead?

sounds better, right? Reducing undercommunication and misunderstandings.

<label> [decorations]: <subject>

[discussion]

read more: Conventional Comments (opens in a new tab)