Minos Galanakis | befc836 | 2021-06-29 14:41:04 +0100 | [diff] [blame] | 1 | ########## |
| 2 | Checkpatch |
| 3 | ########## |
| 4 | |
| 5 | This tool uses the `checkpatch`_ tool, with a prexisting configuration, created |
| 6 | for the TF-M OpenCI, to perform static checking on the developer's machine. |
| 7 | |
| 8 | The script is set by default, to mimic the configuratio of `TF-M OpenCI script`_, |
| 9 | but the user can extend it by adding new parameters in the ``checkpatch.conf`` file. |
| 10 | |
| 11 | The script is kept simple by design, since it is aimed at be easy to maintain |
| 12 | from a single's user perspective |
| 13 | |
| 14 | ****** |
| 15 | Set-up |
| 16 | ****** |
| 17 | |
| 18 | Setting up this tool, is a simple operation of retrieving the script and its |
| 19 | dependencies and placing them in the `tf-m-tools\static_checks\checkpatch` |
| 20 | directory: |
| 21 | |
| 22 | - checkpatch.pl |
| 23 | - const_structs.checkpatch |
| 24 | - spelling.txt |
| 25 | |
| 26 | The proccess can be automated, without any special priviledges by invoking the |
| 27 | ``tf-m-tools\static_checks\checkpatch\setup.sh`` script. |
| 28 | |
| 29 | **************** |
| 30 | Using the script |
| 31 | **************** |
| 32 | |
| 33 | The user can call the ``tf-m-tools\static_checks\checkpatch\run_checkpatch.sh`` |
| 34 | script from the ``{$TFM-ROOT}`` directory |
| 35 | |
| 36 | .. code-block:: bash |
| 37 | |
| 38 | cd $TFM-ROOT |
| 39 | # Only need to be run once |
| 40 | ../tf-m-tools/static_checks/checkpatch/setup.sh |
| 41 | ../tf-m-tools/static_checks/checkpatch/run_checkpatch.sh |
| 42 | |
| 43 | Or as a part of all the tests set in the Static Checking Framework |
| 44 | |
| 45 | .. code-block:: bash |
| 46 | |
| 47 | cd $TFM-ROOT |
| 48 | ../tf-m-tools/static_checks/run_all_checks.sh |
| 49 | |
| 50 | .. _checkpatch: https://www.kernel.org/doc/html/latest/dev-tools/checkpatch.html |
| 51 | .. _TF-M OpenCI script: https://git.trustedfirmware.org/next/ci/tf-m-ci-scripts.git/tree/run-checkpatch.sh?h=refs/heads/master |
| 52 | |
| 53 | *Copyright (c) 2021, Arm Limited. All rights reserved.* |
| 54 | *SPDX-License-Identifier: BSD-3-Clause* |