blob: f62e9a9bb61eb0c57603370d4aed8a27b8f49ba8 [file] [log] [blame]
Minos Galanakisbefc8362021-06-29 14:41:04 +01001##########
2Checkpatch
3##########
4
5This tool uses the `checkpatch`_ tool, with a prexisting configuration, created
6for the TF-M OpenCI, to perform static checking on the developer's machine.
7
8The script is set by default, to mimic the configuratio of `TF-M OpenCI script`_,
9but the user can extend it by adding new parameters in the ``checkpatch.conf`` file.
10
11The script is kept simple by design, since it is aimed at be easy to maintain
12from a single's user perspective
13
14******
15Set-up
16******
17
18Setting up this tool, is a simple operation of retrieving the script and its
19dependencies and placing them in the `tf-m-tools\static_checks\checkpatch`
20directory:
21
22- checkpatch.pl
23- const_structs.checkpatch
24- spelling.txt
25
26The proccess can be automated, without any special priviledges by invoking the
27``tf-m-tools\static_checks\checkpatch\setup.sh`` script.
28
29****************
30Using the script
31****************
32
33The user can call the ``tf-m-tools\static_checks\checkpatch\run_checkpatch.sh``
34script 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
43Or 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*