-
Notifications
You must be signed in to change notification settings - Fork 79
Commits
Try to follow these guidelines when writing commit messages. By following the guidelines our commits will be consistent and easy to work with.
Aim to be clear, concise, descriptive, and precise.
Aim to have your title be 50 characters of less where possible. This makes it display well in git command line tools and on GitHub etc.
π Calculate region coordinates at level 0
Commit messages assume that the first line is the title. The body should therefore be separated by a blank line. Use the body of the commit to include more information, but only if needed. It does not need to be an essay but should be descriptive enough to explain the changes.
:bug Calculate region coordinates at level 0
Fix a bug in the calculation of coordinates when reading regions via OpenSlide during the utils.generate_tiles function. The (x, y) coordinates of a region should be calculated in terms of level 0 rather than the level which the region is being read at.
When writing a commit the imperative mood should be used, e.g. "Fix bug" instead of "Fixes bug" or "Fixed bug". As a result, when reading back commits in the log it is clear what action is performed by each commit as it is applied.
Using the imperative also matches up with git verbs e.g. commit, fetch, pull, push, merge, cherry-pick etc. making the language describing what is being done more clear.
Additionally, avoid the use of personal pronouns e.g. "Fix bug..." instead of "I fixed a bug...".
Fix bug in feature
Add feature
Change feature to do something in a different way
Update README.md
Β
We are using a similar style to gitmoji where a short acronym / keyword in all caps is prepended to the commit title to categories the bug.
Β
π¨:art:
Improve structure / format of the code.
β‘οΈ:zap:
Improve performance.
π₯:fire:
Remove code or files.
π:bug:
Fix a bug.
ποΈ:ambulance:
Critical hotfix.
β¨:sparkles:
Introduce new features.
π :memo:
Add or update documentation.
π:rocket:
Deploy stuff.
π:lipstick:
Add or update the UI and style files.
π:tada:
Begin a project.
β
:white_check_mark:
Add, update, or pass tests.
ποΈ:lock:
Fix security issues.
π:closed_lock_with_key:
Add or update secrets.
π:bookmark:
Release / Version tags.
π¨:rotating_light:
Fix compiler / linter warnings.
π§:construction:
Work in progress.
π:green_heart:
Fix CI Build.
β¬οΈ:arrow_down:
Downgrade dependencies.
β¬οΈ:arrow_up:
Upgrade dependencies.
π:pushpin:
Pin dependencies to specific versions.
π·:construction_worker:
Add or update CI build system.
π:chart_with_upwards_trend:
Add or update analytics or track code.
β»οΈ:recycle:
Refactor code.
β:heavy_plus_sign:
Add a dependency.
β:heavy_minus_sign:
Remove a dependency.
π§:wrench:
Add or update configuration files.
π¨:hammer:
Add or update development scripts.
π:globe_with_meridians:
Internationalization and localization.
βοΈ:pencil2:
Fix typos.
π©:poop:
Write bad code that needs to be improved.
βͺοΈ:rewind:
Revert changes.
π:twisted_rightwards_arrows:
Merge branches.
π¦οΈ:package:
Add or update compiled files or packages.
π½οΈ:alien:
Update code due to external API changes.
π:truck:
Move or rename resources (e.g.: files, paths, routes).
π:page_facing_up:
Add or update license.
π₯:boom:
Introduce breaking changes.
π±:bento:
Add or update assets.
βΏοΈ:wheelchair:
Improve accessibility.
π‘:bulb:
Add or update comments in source code.
π»:beers:
Write code drunkenly.
π¬:speech_balloon:
Add or update text and literals.
ποΈ:card_file_box:
Perform database related changes.
π:loud_sound:
Add or update logs.
π:mute:
Remove logs.
π₯:busts_in_silhouette:
Add or update contributor(s).
πΈ:children_crossing:
Improve user experience / usability.
ποΈ:building_construction:
Make architectural changes.
π±:iphone:
Work on responsive design.
π€‘:clown_face:
Mock things.
π₯:egg:
Add or update an easter egg.
π:see_no_evil:
Add or update a .gitignore file.
πΈ:camera_flash:
Add or update snapshots.
βοΈ:alembic:
Perform experiments.
ποΈ:mag:
Improve SEO.
π·οΈ:label:
Add or update types.
π±:seedling:
Add or update seed files.
π©:triangular_flag_on_post:
Add, update, or remove feature flags.
π₯
:goal_net:
Catch errors.
π«:dizzy:
Add or update animations and transitions.
ποΈ:wastebasket:
Deprecate code that needs to be cleaned up.
π:passport_control:
Work on code related to authorization, roles and permissions.
π©Ή:adhesive_bandage:
Simple fix for a non-critical issue.
π§:monocle_face:
Data exploration/inspection.
β°οΈ:coffin:
Remove dead code.
π§ͺ:test_tube:
Add a failing test.
π:necktie:
Add or update business logic.
π©Ί:stethoscope:
Add or update healthcheck.
π§±:bricks:
Infrastructure related changes.
π§βπ»:technologist:
Improve developer experience.
πΈ:money_with_wings:
Add sponsorships or money related infrastructure.
π§΅:thread:
Add or update code related to multithreading or concurrency.
π¦Ί:safety_vest:
Add or update code related to validation.
Β
Remember to add a line break at or before your message body reaches 72 characters. Many git tools with not auto wrap line and adding them in manually will make the messages display properly later.
Typos are easily done. Please make a mental (or actual) checklist item to check for typos, particularly in title. If you do spot a mistake, you can always correct it via `git rebase -i` before pushing to your fork or making a pull request.
Make sure to start the title line with a capital letter. Think of it like writing an email subject line.
Simple.
Including the issue number makes it clear what issue this commit relates to. Additionally, GitHub will detect this and automatically link to the issue when viewed online.
BUG: Calculate region coordinates at level 0
Fix a bug in the calculation of coordinates when reading regions via OpenSlide during the utils.generate_tiles function. The (x, y) coordinates of a region should be calculated in terms of level 0 rather than the level which the region is being read at.
Resolves issue #123.
The pre-commit package is in the requirements dev files and should already be installed if you have set up an environment. Otherwise you can install via pip, conda, homebrew etc.
Simply run
$ pre-commit install
Β once within the repo after cloning to enable pre-commit hooks. This will format and check your code for you before you commit using black and flake8.
You can manually trigger the checks without committing your changes after you have staged files (git add) by running
$ pre-commit run
Note that you can skip the checks for a particular commit if you really need to (e.g. if you want to commit just part of a file and another part is causing the check to fail). See https://pre-commit.com/#temporarily-disabling-hooks for more.
If you simply want to make a commit and ignore any pre-commit errors, you can use the --no-verify
option:
$ git commit --no-verify