From: Simon Glass Date: Sun, 18 Nov 2018 08:16:54 -0700 Subject: [U-Boot] [PATCH] RFC: checkpatch: Add a check for tests needed for uclasses Message-ID: <20181118151654.116589-1-sjg@chromium.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de This is an experimental check for adding new uclasses without a test. I am not sure of the best way to add U-Boot-specific tests, although in this case, it would not fire on Linux. Signed-off-by: Simon Glass --- scripts/checkpatch.pl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 373094e59ef..2f9edb429d5 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -3033,6 +3033,13 @@ sub process { "adding a line without newline at end of file\n" . $herecurr); } + # ask for a test if a new uclass ID is added + if ($realfile =~ /uclass-id.h/ && $line =~ /^\+/) { + WARN("NEW_UCLASS", + "Possible new uclass - make sure to add a test in test/dm/.c\n" . $herecurr); + } + + # check we are in a valid source file C or perl if not then ignore this hunk next if ($realfile !~ /\.(h|c|pl|dtsi|dts)$/); -- 2.19.1.1215.g8438c0b245-goog