coreboot/util/lint
Nicholas Sudsgaard 48207895af lint: Warn about using change IDs for merged changes
This script will warn and suggest fixes when a CB:<change-id> of an
already merged change is found in the commit message. This should
enforce the clarification that was added to the documentation in
CB:88776.

This script requires a JSON parser (i.e. jq) to parse Gerrit's
REST API[1]. While it may be possible to grep the values, we chose to
use a proper parser to ensure there would be no false-positives.

TEST=
Prepare a commit with the following commit message:

  Here are some open changes: CB:88614 CB:88717 CB:87282
  Here are some abandoned changes: CB:88413 CB:84504 CB:82136
  Here are some merged changes: CB:88566 CB:88598 CB:88697
  Here are some old merged commits: CB:1 CB:50 CB:950
  Here are some wrong stuff: CL:100 CB:TEST CB:99999

The script produces the following result (may change in the future when
open changes are merged etc):

  Using a change ID (CB:88566) for an already merged commit; please replace it with:
  commit 21639c3771 ("mb/getac/p470: Use common gpio functions")
  Using a change ID (CB:88598) for an already merged commit; please replace it with:
  commit 05a38e2af3 ("mb/google/fatcat: Disable memory training progress bar")
  Using a change ID (CB:88697) for an already merged commit; please replace it with:
  commit 1da2f46db8 ("soc/intel/alderlake: Restore mem_init_override_channel_mask()")
  Using a change ID (CB:1) for an already merged commit; please replace it with:
  commit 140a990a61 ("Teach abuild to emit JUnit formatted build reports")
  Using a change ID (CB:50) for an already merged commit; please replace it with:
  commit 7c634ae8c1 ("msrtool: added support for Intel CPUs")
  Using a change ID (CB:950) for an already merged commit; please replace it with:
  commit c31384e62c ("Fix up Sandybridge C state generation code")
  CB:99999 does not exist

[1] https://gerrit-review.googlesource.com/Documentation/rest-api.html

Change-Id: I1c72f739b1f47b1227ef1e158b1553aa56945d7e
Signed-off-by: Nicholas Sudsgaard <devel+coreboot@nsudsgaard.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/88715
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
2025-08-19 20:57:26 +00:00
..
check-style
check_lint_tests
checkpatch.pl
checkpatch_json.py
const_structs.checkpatch
coreboot.dict
description.md
helper_functions.sh
kconfig_lint util/lint/kconfig_lint: Fix operator precedence issue 2025-08-02 01:46:36 +00:00
kconfig_lint_README
lint util/lint: Add support for FreeBSD 2025-03-10 15:17:36 +00:00
lint-000-license-headers util/lint/lint-000-license-headers: Add license 2025-02-14 17:11:40 +00:00
lint-001-no-global-config-in-romstage
lint-007-checkpatch
lint-008-kconfig
lint-014-qualified-types
lint-extended-007-checkpatch util/lint: Remove missing dirs from checkpatch linter 2025-06-29 22:34:57 +00:00
lint-extended-015-final-newlines util/lint: Improve final newline check 2025-06-29 22:34:38 +00:00
lint-extended-020-signed-off-by
lint-extended-025-merged-change-ids lint: Warn about using change IDs for merged changes 2025-08-19 20:57:26 +00:00
lint-stable-000-license-headers
lint-stable-003-whitespace
lint-stable-004-style-labels
lint-stable-005-board-status
lint-stable-006-board-name
lint-stable-008-kconfig
lint-stable-009-old-licenses util/riscv: Add starfive Image building tool 2025-02-14 17:11:34 +00:00
lint-stable-010-asm-syntax
lint-stable-012-executable-bit
lint-stable-013-site-local
lint-stable-016-non-ascii
lint-stable-017-configs
lint-stable-018-symlinks
lint-stable-019-header-files
lint-stable-021-coreboot-lowercase util/lint: Ignore binary files for cb lowercase linter 2025-06-29 22:33:23 +00:00
lint-stable-022-clang-format
lint-stable-023-filenames
lint-stable-024-kconfig-no-subsystem
lint-stable-026-line-endings
lint-stable-027-maintainers-syntax
lint-stable-028-touchpad-probed-warning
lint-stable-029-kconfig-name-selects
lint-stable-030-makefile-inc
lint-stable-031-gofmt util/lint: Add lint file for gofmt 2025-05-10 22:49:22 +00:00
Makefile
remccoms3.sed
spelling.txt