From 0efc2f75aef09b2fcc0da9b4ae53cad41f255879 Mon Sep 17 00:00:00 2001 From: Lucas dos Santos Alves <30706052+lucasdsalves@users.noreply.github.com> Date: Tue, 23 May 2023 22:04:50 -0300 Subject: [PATCH] feat: :memo: update post conventional commits --- data/blog/an-introduction-to-rabbitmq.mdx | 2 +- data/blog/conventional-commits.mdx | 62 ++++++++++++++++++----- 2 files changed, 49 insertions(+), 15 deletions(-) diff --git a/data/blog/an-introduction-to-rabbitmq.mdx b/data/blog/an-introduction-to-rabbitmq.mdx index c5cd937..713468f 100644 --- a/data/blog/an-introduction-to-rabbitmq.mdx +++ b/data/blog/an-introduction-to-rabbitmq.mdx @@ -1,7 +1,7 @@ --- title: An introduction to RabbitMQ date: '2023-05-16' -tags: ['#rabbitmq'] +tags: ['#rabbitmq', '#messagebroker'] draft: false summary: A brief overview of RabbitMQ's main concepts images: [] diff --git a/data/blog/conventional-commits.mdx b/data/blog/conventional-commits.mdx index 3aa872c..8bca975 100644 --- a/data/blog/conventional-commits.mdx +++ b/data/blog/conventional-commits.mdx @@ -1,7 +1,7 @@ --- title: Conventional commits date: '2023-02-10' -tags: ['#git'] +tags: ['#git', '#conventionalcommits'] draft: false summary: How your commit message can make a difference images: [] @@ -11,16 +11,15 @@ canonicalUrl: ## Conventional commits, have you ever heard of it? -As developers, we are writers. As writers, we intend to communicate through everything we write such as code, documentation and also commits messages. +As developers, we are writers. As writers, we intend to communicate through everything we write such as code, documentation and also commit messages. [Conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) are a standardized format for writing **commit messages**. -By adopting conventional commits, teams can create commit messages that follow the same structure, and format, -making easier to review and understand changes that have been made in the codebase. +By adopting conventional commits, teams can create commit messages that follow the same structure, and format, making it easier to review and understand changes made in the codebase. -It clearly helps avoiding terrible commit messages with no meaning and increases team's communication through git commits messages. +It clearly helps avoid terrible commit messages with no meaning and increases the team's communication through git commit messages. -Conventional Commits are related to [Semantic Versioning](https://semver.org/) assisting in controlling major, minors and patch versions. +Conventional Commits are related to [Semantic Versioning](https://semver.org/) assisting in controlling major, minors, and patch versions. ## How does it work? @@ -32,33 +31,68 @@ According to Conventional Commits, the commit message should be structured as: [optional footer(s)] ``` +The **type** is an indicator of what has changed. Some of the most famous types will be listed [below](#types-of-commits) in this post. + The **scope** is optional and used to indicate which part of the project was changed. -The **description** is a brief description of the change. Should be written in imperative mood. +The **description** is a brief description of the change. Should be written in an imperative mood. -The **body** is free-form and may consist of any number of newline separated paragraphs. +The **body** is free-form and may consist of any number of newline-separated paragraphs. ## Types of commits - **feat** - introduces a new feature to the codebase - **fix** - a bug fix - **docs** - changes to documentation -- **style** - changes that are related to white-spaces, formatting, removing comments, missing semil-colons -- **refactor** - reactoring of code +- **style** - changes that are related to white spaces, formatting, removing comments, missing semi-colons +- **refactor** - refactoring of code - **test** - addition of tests or correcting existing ones - **build** - changes related to the build of the application or external dependencies - **ci** - changes made to the continuous integration configuration files and scripts -_BREAKING CHANGE_ +A commit that has a footer **_BREAKING CHANGE:_**, or appends a **_!_** after the _type[scope]_ introduces a change that can break the app and it is usually associated with a new major version. ## A few examples -The following examples are on the Conventional Commits documentation +The following examples are on the Conventional Commits documentation. + +**Commit message with ! to draw attention to breaking change** + +``` +feat!: send an email to the customer when a product is shipped +``` + +**Commit message with scope** + +``` +feat(lang): add Polish language +``` + +**Commit message with multi-paragraph body and multiple footers** + +``` +fix: prevent racing of requests + +Introduce a request id and a reference to latest request. Dismiss +incoming responses other than from latest request. + +Remove timeouts which were used to mitigate the racing issue but are +obsolete now. + +Reviewed-by: Z +Refs: #123 +``` ## VS Code extension -The [Conventional Commits](https://marketplace.visualstudio.com/items?itemName=vivaxy.vscode-conventional-commits) VS Code extension is very helpful to write commits the Conventional Commits way. +The [Conventional Commits VS Code extension](https://marketplace.visualstudio.com/items?itemName=vivaxy.vscode-conventional-commits) is very helpful extension to write commits the Conventional Commits way. -![commit](https://github.com/vivaxy/vscode-conventional-commits/raw/HEAD/assets/docs/icon-on-the-source-control-menu.png) +![ccVsCodeExt](https://github.com/vivaxy/vscode-conventional-commits/raw/HEAD/assets/docs/demo.gif) ## Commitlint + +You can also set your project up with Conventional Commits using [Commitlint](https://commitlint.js.org/#/). + +Commitlint checks if your commit messages meet the Conventional Commits format. + +![commitlint](https://commitlint.js.org/assets/commitlint.svg)