diff options
author | Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> | 2020-07-28 19:20:40 +0300 |
---|---|---|
committer | Jonathan Corbet <corbet@lwn.net> | 2020-07-31 20:11:17 +0300 |
commit | 2c12c8103d8f15790cf880f1545dafa36acb004a (patch) | |
tree | 1d8ab9cb78e9008de2008bd271b455280a96da4b /Documentation/core-api/cpu_hotplug.rst | |
parent | d4210f7013321dc6e5796445823935693ac3d83b (diff) | |
download | linux-2c12c8103d8f15790cf880f1545dafa36acb004a.tar.xz |
scripts/kernel-doc: optionally treat warnings as errors
The kbuild bot recently added the W=1 option, which triggered
documentation cleanups to squelch hundreds of kernel-doc warnings.
To make sure new kernel contributions don't add regressions to
kernel-doc descriptors, this patch suggests an option to treat
warnings as errors in CI/automated tests.
A -Werror command-line option is added to the kernel-doc script. When
this option is set, the script will return the number of warnings
found. The caller can then treat this positive return value as an
error and stop the build.
Using this command line option is however not straightforward when the
kernel-doc script is called from other scripts. To align with typical
kernel compilation or documentation generation, the Werror option is
also set by checking the KCFLAGS environment variable, or if
KDOC_WERROR is defined, as in the following examples:
KCFLAGS="-Wall -Werror" make W=1 sound/
KCFLAGS="-Wall -Werror" make W=1 drivers/soundwire/
KDOC_WERROR=1 make htmldocs
Note that in the last example the documentation build does not stop,
only an additional log is provided.
Credits to Randy Dunlap for suggesting the use of environment variables.
Suggested-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200728162040.92467-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'Documentation/core-api/cpu_hotplug.rst')
0 files changed, 0 insertions, 0 deletions