tfa-next: add static and lint checks
1. Copyright exists on new files (error) + are correctly dated
(warn)
2. Line endings are Unix style, not Windows
3. Cargo fmt --check - returns error if format issues found
4. Clippy - various lints, both error + warn
Checks 1+2 call the pre-existing scripts in the static-checks/ dir, 3+4
are newly implemented checks in the next-checks/ dir.
clippy is currently set to only fail on DENY level errors[1]. There are
many warnings currently in the prototype RF-A, however in future we
should look to enable the '-Dwarnings' flag to turn WARN into fail.
clippy is set to run twice for simplicity: once for fvp, once for qemu.
The '--all-features' flag to clippy exists and would allow a single run,
however rust/build.rs contains a check to ensure the Rust flag `--cfg
platform=${PLAT}` is set (where $PLAT is an env var passed to the make
command). This would mean some additional work is required to enable
'--all-features'. This work should be considered for future scaling to
additional platforms however is beyond the scope of this patch.
1: https://rust-lang.github.io/rust-clippy/master/index.html?levels=deny
Signed-off-by: Zachary Leaf <zachary.leaf@arm.com>
Change-Id: I31876f2d547d90c6d255ab1ebe8f8b205a6951fe
diff --git a/script/static-checks/check-copyright.py b/script/static-checks/check-copyright.py
index a05b4ca..2bdfa93 100755
--- a/script/static-checks/check-copyright.py
+++ b/script/static-checks/check-copyright.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
-# Copyright (c) 2019-2020, Arm Limited. All rights reserved.
+# Copyright (c) 2019-2024, Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
@@ -28,7 +28,7 @@
# File extensions to check
VALID_FILE_EXTENSIONS = ('.c', '.conf', '.dts', '.dtsi', '.editorconfig',
'.h', '.i', '.ld', 'Makefile', '.mk', '.msvc',
- '.py', '.S', '.scat', '.sh')
+ '.py', '.S', '.scat', '.sh', '.rs')
# Paths inside the tree to ignore. Hidden folders and files are always ignored.
# They mustn't end in '/'.