disnake icon indicating copy to clipboard operation
disnake copied to clipboard

Implement commit convention in the repository.

Open abhigyantrips opened this issue 4 years ago • 0 comments

Summary

A "commit convention" simply refers to a commit name and/or message template that is followed by all commits and PRs to the repository.

What is the feature request for?

The core library

The Problem

(The feature request is for the GitHub repository.)

Currently, our repo's commit names do not fully imply the contribution made, the section changed/added, which part of the repo is affected by it, and so on. This also causes an inconsistency in the commit history, which can later on make it difficult to search as to which commit made a specific change.

Our commit history can have an impression of our development practices and standard on a user browsing the repository, and thus can make or break what a user believes about our library.

The Ideal Solution

Having a convention/set of rules for the commits makes it easier to search for specific requirements - let it be for docs, feature additions, revert commits, or breaking changes. It also creates a discipline and uniformity that is followed by all contributors.

Implementing this can also give us an edge over competing forks. Think of it as type-safety, but for our commits. :P

My current notion is that we learn and implement from discord.js's commit convention guidelines. This includes a regex as follows:

/^(revert: )?(feat|fix|docs|style|refactor|perf|test|workflow|build|ci|chore|types|wip)(\(.+\))?: .{1,72}/;

The library will probably require tweaking this according to our directory structure, but this essentially introduces a "tag" that each commit would accordingly include, listing the section changed in parantheses. We can also alternatively refer to https://www.conventionalcommits.org/

For example, a commit to the documentation would include docs(on_message): Update parameter descriptions. This can make it simpler to search for documentation-only commits later, as well as make it easier to understand commits on the repo's frontpage (and in GitHub notifications) as to which part of the library was modified.

Additional Context

The example of discord.js's contribution guidelines is ofcourse, a suggestion and just one of the ways to do it. The intention is that we:

  1. Make it easier to read and understand what a commit/PR modifies.
  2. Make it easier to search for commits related to a certain filter.
  3. Standardize commit names and messages, for all contributors to follow.
  4. And as a result, clean up the contribution activity of the repository.

abhigyantrips avatar Dec 13 '21 07:12 abhigyantrips