summaryrefslogtreecommitdiffstats
path: root/tools/patman/checkpatch.py
Commit message (Collapse)AuthorAgeFilesLines
* tools, scripts: refactor error-out statements of Python scriptsMasahiro Yamada2014-08-211-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In Python, sys.exit() function can also take an object other than an integer. If an integer is given to the argument, Python exits with the return code of it. If a non-integer argument is given, Python outputs it to stderr and exits with the return code of 1. That means, print >> sys.stderr, "Blah Blah" sys.exit(1) is equivalent to sys.exit("Blah Blah") The latter is a useful shorthand. Note: Some error messages in Buildman and Patman were output to stdout. But they should go to stderr. They are also fixed by this commit. This is a nice side effect. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org>
* Add GPL-2.0+ SPDX-License-Identifier to source filesWolfgang Denk2013-07-241-17/+1
| | | | | | Signed-off-by: Wolfgang Denk <wd@denx.de> [trini: Fixup common/cmd_io.c] Signed-off-by: Tom Rini <trini@ti.com>
* patman: Fix up checkpatch parsing to deal with 'CHECK' linesSimon Glass2013-04-041-42/+68
| | | | | | | | | | | | | | | checkpatch has a new type of warning, a 'CHECK'. At present patman fails with these, which makes it less than useful. Add support for checks, making it backwards compatible with the old checkpatch. At the same time, clean up formatting of the CheckPatches() output, fix erroneous "internal error" if multiple patches have warnings and be more robust to new types of problems. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Doug Anderson <dianders@chromium.org>
* patman: Allow use outside of u-boot treeVadim Bendebury2013-01-311-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | To make it usable in git trees not providing a patch checker implementation, add a command line option, allowing to suppress patch check. While we are at it, sort debug options alphabetically. Also, do not raise an exception if checkpatch.pl is not found - just print an error message suggesting to use the new option, and return nonzero status. . unit test passes: $ ./patman -t <unittest.result.TestResult run=7 errors=0 failures=0> . successfully used patman in the autotest tree to generate a patch email (with --no-check option) . successfully used patman in the u-boot tree to generate a patch email . `patman --help' now shows command line options ordered alphabetically Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Acked-by: Doug Anderson <dianders@chromium.org> Acked-by: Simon Glass <sjg@chromium.org>
* patman: Look for checkpatch in the scripts directoryDoug Anderson2013-01-311-1/+3
| | | | | | | | | The Linux kernel stores checkpatch.pl in the scripts directory. Add that to the search path to make things more automatic for kernel development. Signed-off-by: Doug Anderson <dianders@chromium.org> Acked-by: Simon Glass <sjg@chromium.org>
* patman: Handle checkpatch.pl not providing file/line infoSimon Glass2012-10-151-2/+3
| | | | | | | | Sometimes we don't get a valid filename or line number from checkpatch.pl, for example if the patch is in a bad format. Deal with this by using a default value, rather than a stack trace. Signed-off-by: Simon Glass <sjg@chromium.org>
* Add 'patman' patch generation, checking and submission scriptSimon Glass2012-04-211-0/+161
What is this? ============= This tool is a Python script which: - Creates patch directly from your branch - Cleans them up by removing unwanted tags - Inserts a cover letter with change lists - Runs the patches through checkpatch.pl and its own checks - Optionally emails them out to selected people It is intended to automate patch creation and make it a less error-prone process. It is useful for U-Boot and Linux work so far, since it uses the checkpatch.pl script. It is configured almost entirely by tags it finds in your commits. This means that you can work on a number of different branches at once, and keep the settings with each branch rather than having to git format-patch, git send-email, etc. with the correct parameters each time. So for example if you put: in one of your commits, the series will be sent there. See the README file for full details. END Signed-off-by: Simon Glass <sjg@chromium.org>
OpenPOWER on IntegriCloud