* [edk2-devel] [edk2-redfish-client][PATCH 01/13] RedfishClientPkg/.github: do not run uncrustify to deleted file.
@ 2024-02-29 8:52 Nickle Wang via groups.io
2024-03-04 1:53 ` Chang, Abner via groups.io
0 siblings, 1 reply; 2+ messages in thread
From: Nickle Wang via groups.io @ 2024-02-29 8:52 UTC (permalink / raw)
To: devel; +Cc: Abner Chang, Igor Kulchytskyy
Check to see if file exists or not before running uncrustify.
The file in change list may be a deleted file.
Signed-off-by: Nickle Wang <nicklew@nvidia.com>
Cc: Abner Chang <abner.chang@amd.com>
Cc: Igor Kulchytskyy <igork@ami.com>
---
.github/workflows/uncrustify-check.sh | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/.github/workflows/uncrustify-check.sh b/.github/workflows/uncrustify-check.sh
index 7c1765cff..e6cf00b1f 100755
--- a/.github/workflows/uncrustify-check.sh
+++ b/.github/workflows/uncrustify-check.sh
@@ -1,6 +1,6 @@
#!/bin/bash
#
-# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+# Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
@@ -40,12 +40,17 @@ fi
for file in $CHANGED_FILES
do
- echo "Uncrustify check file: $file"
- uncrustify -c $CONFIG_FILE -f $file --check
- if [ $? -ne 0 ]
+ if [ -e "$file" ]
then
- echo "Uncrustify check failure on file: $file"
- FAILURE=1
+ echo "Uncrustify check file: $file"
+ uncrustify -c $CONFIG_FILE -f $file --check
+ if [ $? -ne 0 ]
+ then
+ echo "Uncrustify check failure on file: $file"
+ FAILURE=1
+ fi
+ else
+ echo "File does not exist (deleted file?): $file"
fi
done
--
2.34.1
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116141): https://edk2.groups.io/g/devel/message/116141
Mute This Topic: https://groups.io/mt/104640215/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [edk2-devel] [edk2-redfish-client][PATCH 01/13] RedfishClientPkg/.github: do not run uncrustify to deleted file.
2024-02-29 8:52 [edk2-devel] [edk2-redfish-client][PATCH 01/13] RedfishClientPkg/.github: do not run uncrustify to deleted file Nickle Wang via groups.io
@ 2024-03-04 1:53 ` Chang, Abner via groups.io
0 siblings, 0 replies; 2+ messages in thread
From: Chang, Abner via groups.io @ 2024-03-04 1:53 UTC (permalink / raw)
To: Nickle Wang, devel@edk2.groups.io; +Cc: Igor Kulchytskyy
[AMD Official Use Only - General]
Reviewed-by: Abner Chang <abner.chang@amd.com>
> -----Original Message-----
> From: Nickle Wang <nicklew@nvidia.com>
> Sent: Thursday, February 29, 2024 4:53 PM
> To: devel@edk2.groups.io
> Cc: Chang, Abner <Abner.Chang@amd.com>; Igor Kulchytskyy
> <igork@ami.com>
> Subject: [edk2-redfish-client][PATCH 01/13] RedfishClientPkg/.github: do not
> run uncrustify to deleted file.
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> Check to see if file exists or not before running uncrustify.
> The file in change list may be a deleted file.
>
> Signed-off-by: Nickle Wang <nicklew@nvidia.com>
> Cc: Abner Chang <abner.chang@amd.com>
> Cc: Igor Kulchytskyy <igork@ami.com>
> ---
> .github/workflows/uncrustify-check.sh | 17 +++++++++++------
> 1 file changed, 11 insertions(+), 6 deletions(-)
>
> diff --git a/.github/workflows/uncrustify-check.sh
> b/.github/workflows/uncrustify-check.sh
> index 7c1765cff..e6cf00b1f 100755
> --- a/.github/workflows/uncrustify-check.sh
> +++ b/.github/workflows/uncrustify-check.sh
> @@ -1,6 +1,6 @@
> #!/bin/bash
> #
> -# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights
> reserved.
> +# Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights
> reserved.
> #
> # SPDX-License-Identifier: BSD-2-Clause-Patent
> #
> @@ -40,12 +40,17 @@ fi
>
> for file in $CHANGED_FILES
> do
> - echo "Uncrustify check file: $file"
> - uncrustify -c $CONFIG_FILE -f $file --check
> - if [ $? -ne 0 ]
> + if [ -e "$file" ]
> then
> - echo "Uncrustify check failure on file: $file"
> - FAILURE=1
> + echo "Uncrustify check file: $file"
> + uncrustify -c $CONFIG_FILE -f $file --check
> + if [ $? -ne 0 ]
> + then
> + echo "Uncrustify check failure on file: $file"
> + FAILURE=1
> + fi
> + else
> + echo "File does not exist (deleted file?): $file"
> fi
> done
>
> --
> 2.34.1
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116297): https://edk2.groups.io/g/devel/message/116297
Mute This Topic: https://groups.io/mt/104640215/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-03-04 1:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-29 8:52 [edk2-devel] [edk2-redfish-client][PATCH 01/13] RedfishClientPkg/.github: do not run uncrustify to deleted file Nickle Wang via groups.io
2024-03-04 1:53 ` Chang, Abner via groups.io
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox