diff options
| author | Erovia <Erovia@users.noreply.github.com> | 2020-09-06 13:06:12 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-09-06 13:06:12 +0100 |
| commit | ac24f203cc4141d6d27f27dc173e04fc5edde741 (patch) | |
| tree | 10ffa9431363417a6a8aeb1aa64ff555bf9fd3b0 /docs/pr_checklist.md | |
| parent | d0eabd083ebe13b864dd7628b43096c8362d0f29 (diff) | |
| download | qmk_firmware-ac24f203cc4141d6d27f27dc173e04fc5edde741.tar.gz qmk_firmware-ac24f203cc4141d6d27f27dc173e04fc5edde741.zip | |
Docs/PR_checklist: Reorder, unify and pet-peeves (#10253)
Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com>
Diffstat (limited to 'docs/pr_checklist.md')
| -rw-r--r-- | docs/pr_checklist.md | 69 |
1 files changed, 36 insertions, 33 deletions
diff --git a/docs/pr_checklist.md b/docs/pr_checklist.md index 8755552b9..22e8a3fe1 100644 --- a/docs/pr_checklist.md +++ b/docs/pr_checklist.md | |||
| @@ -1,39 +1,42 @@ | |||
| 1 | # PR checklists | 1 | # PR checklists |
| 2 | 2 | ||
| 3 | This is a non-exhaustive checklist of what the QMK collaborators will be checking when reviewing submitted PRs. | 3 | This is a non-exhaustive checklist of what the QMK Collaborators will be checking when reviewing submitted PRs. |
| 4 | 4 | ||
| 5 | If there are any inconsistencies with these recommendations, you're best off [creating an issue](https://github.com/qmk/qmk_firmware/issues/new) against this document, or getting in touch with a QMK Collaborator on Discord. | 5 | If there are any inconsistencies with these recommendations, you're best off [creating an issue](https://github.com/qmk/qmk_firmware/issues/new) against this document, or getting in touch with a QMK Collaborator on [Discord](https://discord.gg/Uq7gcHh). |
| 6 | 6 | ||
| 7 | ## General PRs | 7 | ## General PRs |
| 8 | 8 | ||
| 9 | - PR should be submitted using a non-`master` branch on the source repository | 9 | - PR should be submitted using a non-`master` branch on the source repository |
| 10 | - This does not mean you target a different branch for your PR, rather that you're not working out of your own master branch | 10 | - this does not mean you target a different branch for your PR, rather that you're not working out of your own master branch |
| 11 | - If submitter _does_ use their own `master` branch, they'll be given a link to the ["how to git"](https://docs.qmk.fm/#/newbs_git_using_your_master_branch) page after merging -- (end of this document will contain the contents of the message) | 11 | - if submitter _does_ use their own `master` branch, they'll be given a link to the ["how to git"](https://docs.qmk.fm/#/newbs_git_using_your_master_branch) page after merging -- (end of this document will contain the contents of the message) |
| 12 | - Newly-added directories and filenames must be lowercase | 12 | - newly-added directories and filenames must be lowercase |
| 13 | - This rule may be relaxed if upstream sources originally had uppercase characters (e.g. ChibiOS, or imported files from other repositories etc.) | 13 | - this rule may be relaxed if upstream sources originally had uppercase characters (e.g. ChibiOS, or imported files from other repositories etc.) |
| 14 | - If there is enough justification (i.e. consistency with existing core files etc.) this can be relaxed | 14 | - if there is enough justification (i.e. consistency with existing core files etc.) this can be relaxed |
| 15 | - a board designer naming their keyboard with uppercase letters is not enough justification | 15 | - a board designer naming their keyboard with uppercase letters is not enough justification |
| 16 | - Valid license headers on all `*.c` and `*.h` source files | 16 | - valid license headers on all `*.c` and `*.h` source files |
| 17 | - GPL2/GPL3 recommended for consistency | 17 | - GPL2/GPL3 recommended for consistency |
| 18 | - Other licenses are permitted, however they must be GPL-compatible and must allow for redistribution. Using a different license will almost certainly delay a PR getting merged. | 18 | - other licenses are permitted, however they must be GPL-compatible and must allow for redistribution. Using a different license will almost certainly delay a PR getting merged. |
| 19 | - QMK codebase "best practices" followed | 19 | - QMK Codebase "best practices" followed |
| 20 | - This is not an exhaustive list, and will likely get amended as time goes by | 20 | - this is not an exhaustive list, and will likely get amended as time goes by |
| 21 | - `#pragma once` instead of `#ifndef` include guards in header files | 21 | - `#pragma once` instead of `#ifndef` include guards in header files |
| 22 | - No "old-school" GPIO/I2C/SPI functions used -- must use QMK abstractions unless justifiable (and laziness is not valid justification) | 22 | - no "old-school" GPIO/I2C/SPI functions used -- must use QMK abstractions unless justifiable (and laziness is not valid justification) |
| 23 | - Timing abstractions should be followed too: | 23 | - timing abstractions should be followed too: |
| 24 | - `wait_ms()` instead of `_delay_ms()` (remove `#include <util/delay.h>` too) | 24 | - `wait_ms()` instead of `_delay_ms()` (remove `#include <util/delay.h>` too) |
| 25 | - `timer_read()` and `timer_read32()` etc. -- see [timer.h](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/common/timer.h) for the timing APIs | 25 | - `timer_read()` and `timer_read32()` etc. -- see [timer.h](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/common/timer.h) for the timing APIs |
| 26 | - If you think a new abstraction is useful, you're encouraged to: | 26 | - if you think a new abstraction is useful, you're encouraged to: |
| 27 | - prototype it in your own keyboard until it's feature-complete | 27 | - prototype it in your own keyboard until it's feature-complete |
| 28 | - discuss it with QMK Collaborators on Discord | 28 | - discuss it with QMK Collaborators on Discord |
| 29 | - refactor it as a separate core change | 29 | - refactor it as a separate core change |
| 30 | - remove your specific copy in your board | 30 | - remove your specific copy in your board |
| 31 | - rebase and fix all merge conflicts before opening the PR (in case you need help or advice, reach out to QMK Collaborators on Discord) | ||
| 31 | 32 | ||
| 32 | ## Core PRs | 33 | ## Keymap PRs |
| 33 | 34 | ||
| 34 | - Must now target `develop` branch, which will subsequently be merged back to `master` on the breaking changes timeline | 35 | - `#include QMK_KEYBOARD_H` preferred to including specific board files |
| 35 | - Other notes TBD | 36 | - prefer layer `enum`s to `#define`s |
| 36 | - Core is a lot more subjective given the breadth of posted changes | 37 | - require custom keycode `enum`s to `#define`s, first entry must have ` = SAFE_RANGE` |
| 38 | - terminating backslash (`\`) in lines of LAYOUT macro parameters is superfluous | ||
| 39 | - some care with spacing (e.g., alignment on commas or first char of keycodes) makes for a much nicer-looking keymap | ||
| 37 | 40 | ||
| 38 | ## Keyboard PRs | 41 | ## Keyboard PRs |
| 39 | 42 | ||
| @@ -48,12 +51,14 @@ https://github.com/qmk/qmk_firmware/pulls?q=is%3Apr+is%3Aclosed+label%3Akeyboard | |||
| 48 | - standard template should be present | 51 | - standard template should be present |
| 49 | - flash command has `:flash` at end | 52 | - flash command has `:flash` at end |
| 50 | - valid hardware availability link (unless handwired) -- private groupbuys are okay, but one-off prototypes will be questioned. If open-source, a link to files should be provided. | 53 | - valid hardware availability link (unless handwired) -- private groupbuys are okay, but one-off prototypes will be questioned. If open-source, a link to files should be provided. |
| 54 | - clear instructions on how to reset the board into bootloader mode | ||
| 55 | - a picture about the keyboard and preferably about the PCB, too | ||
| 51 | - `rules.mk` | 56 | - `rules.mk` |
| 52 | - removed `MIDI_ENABLE`, `FAUXCLICKY_ENABLE` and `HD44780_ENABLE` | 57 | - removed `MIDI_ENABLE`, `FAUXCLICKY_ENABLE` and `HD44780_ENABLE` |
| 53 | - modified `# Enable Bluetooth with the Adafruit EZ-Key HID` -> `# Enable Bluetooth` | 58 | - modified `# Enable Bluetooth with the Adafruit EZ-Key HID` -> `# Enable Bluetooth` |
| 54 | - No `(-/+size)` comments related to enabling features | 59 | - no `(-/+size)` comments related to enabling features |
| 55 | - Remove the list of alternate bootloaders if one has been specified | 60 | - remove the list of alternate bootloaders if one has been specified |
| 56 | - No re-definitions of the default MCU parameters if same value, when compared to the equivalent MCU in [mcu_selection.mk](https://github.com/qmk/qmk_firmware/blob/master/quantum/mcu_selection.mk) | 61 | - no re-definitions of the default MCU parameters if same value, when compared to the equivalent MCU in [mcu_selection.mk](https://github.com/qmk/qmk_firmware/blob/master/quantum/mcu_selection.mk) |
| 57 | - keyboard `config.h` | 62 | - keyboard `config.h` |
| 58 | - don't repeat `MANUFACTURER` in the `PRODUCT` value | 63 | - don't repeat `MANUFACTURER` in the `PRODUCT` value |
| 59 | - no `#define DESCRIPTION` | 64 | - no `#define DESCRIPTION` |
| @@ -71,12 +76,12 @@ https://github.com/qmk/qmk_firmware/pulls?q=is%3Apr+is%3Aclosed+label%3Akeyboard | |||
| 71 | - `keyboard.h` | 76 | - `keyboard.h` |
| 72 | - `#include "quantum.h"` appears at the top | 77 | - `#include "quantum.h"` appears at the top |
| 73 | - `LAYOUT` macros should use standard definitions if applicable | 78 | - `LAYOUT` macros should use standard definitions if applicable |
| 74 | - Use the Community Layout macro names where they apply (preferred above `LAYOUT`/`LAYOUT_all`) | 79 | - use the Community Layout macro names where they apply (preferred above `LAYOUT`/`LAYOUT_all`) |
| 75 | - keymap `config.h` | 80 | - keymap `config.h` |
| 76 | - no duplication of `rules.mk` or `config.h` from keyboard | 81 | - no duplication of `rules.mk` or `config.h` from keyboard |
| 77 | - `keymaps/default/keymap.c` | 82 | - `keymaps/default/keymap.c` |
| 78 | - `QMKBEST`/`QMKURL` removed (sheesh) | 83 | - `QMKBEST`/`QMKURL` removed (sheesh) |
| 79 | - If using `MO(_LOWER)` and `MO(_RAISE)` keycodes or equivalent, and the keymap has an adjust layer when holding both keys -- if the keymap has no "direct-to-adjust" keycode (such as `MO(_ADJUST)`) then you should prefer to write... | 84 | - if using `MO(_LOWER)` and `MO(_RAISE)` keycodes or equivalent, and the keymap has an adjust layer when holding both keys -- if the keymap has no "direct-to-adjust" keycode (such as `MO(_ADJUST)`) then you should prefer to write... |
| 80 | ``` | 85 | ``` |
| 81 | layer_state_t layer_state_set_user(layer_state_t state) { | 86 | layer_state_t layer_state_set_user(layer_state_t state) { |
| 82 | return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); | 87 | return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); |
| @@ -90,22 +95,20 @@ https://github.com/qmk/qmk_firmware/pulls?q=is%3Apr+is%3Aclosed+label%3Akeyboard | |||
| 90 | - submitters can also have a "manufacturer-matching" keymap that mirrors existing functionality of the commercial product, if porting an existing board | 95 | - submitters can also have a "manufacturer-matching" keymap that mirrors existing functionality of the commercial product, if porting an existing board |
| 91 | 96 | ||
| 92 | Also, specific to ChibiOS: | 97 | Also, specific to ChibiOS: |
| 93 | - **Strong** preference to using existing ChibiOS board definitions. | 98 | - **strong** preference to using existing ChibiOS board definitions. |
| 94 | - A lot of the time, an equivalent Nucleo board can be used with a different flash size or slightly different model in the same family | 99 | - a lot of the time, an equivalent Nucleo board can be used with a different flash size or slightly different model in the same family |
| 95 | - Example: For an STM32L082KZ, given the similarity to an STM32L073RZ, you can use `BOARD = ST_NUCLEO64_L073RZ` in rules.mk | 100 | - example: For an STM32L082KZ, given the similarity to an STM32L073RZ, you can use `BOARD = ST_NUCLEO64_L073RZ` in rules.mk |
| 96 | - QMK is migrating to not having custom board definitions if at all possible, due to the ongoing maintenance burden when upgrading ChibiOS | 101 | - QMK is migrating to not having custom board definitions if at all possible, due to the ongoing maintenance burden when upgrading ChibiOS |
| 97 | - If a board definition is unavoidable, `board.c` must have a standard `__early_init()` (as per normal ChibiOS board defs) and an empty `boardInit()`: | 102 | - if a board definition is unavoidable, `board.c` must have a standard `__early_init()` (as per normal ChibiOS board defs) and an empty `boardInit()`: |
| 98 | - see Arm/ChibiOS [early initialization](https://docs.qmk.fm/#/platformdev_chibios_earlyinit?id=board-init) | 103 | - see Arm/ChibiOS [early initialization](https://docs.qmk.fm/#/platformdev_chibios_earlyinit?id=board-init) |
| 99 | - `__early_init()` should be replaced by either `early_hardware_init_pre()` or `early_hardware_init_post()` as appropriate | 104 | - `__early_init()` should be replaced by either `early_hardware_init_pre()` or `early_hardware_init_post()` as appropriate |
| 100 | - `boardInit()` should be migrated to `board_init()` | 105 | - `boardInit()` should be migrated to `board_init()` |
| 101 | 106 | ||
| 102 | ## Keymap PRs | 107 | ## Core PRs |
| 103 | 108 | ||
| 104 | - `#include QMK_KEYBOARD_H` preferred to including specific board files | 109 | - must now target `develop` branch, which will subsequently be merged back to `master` on the breaking changes timeline |
| 105 | - Prefer layer `enum`s to `#define`s | 110 | - other notes TBD |
| 106 | - Require custom keycode `enum`s to `#define`s, first entry must have ` = SAFE_RANGE` | 111 | - core is a lot more subjective given the breadth of posted changes |
| 107 | - Terminating backslash (`\`) in lines of LAYOUT macro parameters is superfluous | ||
| 108 | - Some care with spacing (e.g., alignment on commas or first char of keycodes) makes for a much nicer-looking keymap | ||
| 109 | 112 | ||
| 110 | --- | 113 | --- |
| 111 | 114 | ||
