ci(static-checks): skip ignored files when checking patches include order

The script that checks include order skips some files and directories,
when run in a folder. This should be the same when using --patch option.
Use the same utils.file_is_ignored() in inc_order_is_correct() to skip
files.
This was was triggered when checking some device tree files, for which
the order of include is important, but do not match TF-A rules for
include order.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: Idda3c2ad4b10803128396fcf3695ae6139850d2d
diff --git a/script/static-checks/check-include-order.py b/script/static-checks/check-include-order.py
index ffda008..2788a99 100755
--- a/script/static-checks/check-include-order.py
+++ b/script/static-checks/check-include-order.py
@@ -1,6 +1,6 @@
 #!/usr/bin/env python3
 #
-# Copyright (c) 2019-2022, Arm Limited. All rights reserved.
+# Copyright (c) 2019-2023, Arm Limited. All rights reserved.
 #
 # SPDX-License-Identifier: BSD-3-Clause
 #
@@ -76,6 +76,11 @@
     if len(inc_list) < 2:
         return True
 
+    if utils.file_is_ignored(
+            path, VALID_FILE_EXTENSIONS, IGNORED_FILES, IGNORED_FOLDERS
+        ):
+        return True
+
     if commit_hash != "":
         commit_hash = commit_hash + ":"