Code Changes - raisercostin/software-wiki GitHub Wiki
Is best a commit to contain only a type of the following code changes. In this way someone can skip directly unintersting ones
Code transformations are:
- simple
- format/Reformat - changes only the white space: spaces, end of line, tabs, separators.
- cleanup - changes documentation/comments, removal of dead code
- reorderings - changes on the order of imports, functions, class definitions
- refactorings - no intention to change the execution behavior
- Refactoring - Changes that preserve the behavior as checked usually by tests. Usually followed by a bugfix/feature.
- complex - there is intention to change the execution behavior
- bugfix - Changes on code/test that make some tests pass.
- feature - Changed on code/tests made through adding new code: see Open Closed Principle
- restructure - any code change.
- to classify
- merge
- rebases
Comments
Clean Code tip: Write clean commit messages
Itβs the best tool to document the reason for change in your code.
Here are 5 tips on how I write commits in my team:
- Explain the WHY
β Add endpoint β Add endpoint to enable users to download purchase history
- Summarize WHAT the commit does, not HOW it does it:
β Changed the button color by updating CSS file β Update primary button color for better contrast
- Use present tense with imperative mood
β I have removed β Remove ...
- Add link reference to the actual work item
β Fix login bug when user is inactive β d342da: Fix login bug when user is inactive
- Donβt include file names - they are in the Git details β Update dependencies in package.json β Update dependencies to address security vulnerabilities
Clean commit messages are part of internal software quality.
From https://craftbettersoftware.com/p/write-clean-commit-messages
Se also