Hi Mike,

On 12/7/21 3:02 PM, Kinney, Michael D wrote:
Hi Brijesh,

Yes.  Your branch can be rebased on top of edk2/master after uncrustify changes.

You have added new c/h files, so those files need to be run through uncrustify 
locally and
your patch updated with those formatting changes.

The following command updates every c/h file except BaseTools locally.

     git ls-files *.c *.h :!BaseTools/* | 
.pytool\Plugin\UncrustifyCheck\mu-uncrustify-release_extdep\Windows-x86\uncrustify.exe
 -c .pytool\Plugin\UncrustifyCheck\uncrustify.cfg -F - --replace --no-backup 
--if-changed

If you know the package you are working on, the following one will work faster.

     git ls-files <PackageName>*.c <PackageName>*.h :!BaseTools/* | 
.pytool\Plugin\UncrustifyCheck\mu-uncrustify-release_extdep\Windows-x86\uncrustify.exe -c 
.pytool\Plugin\UncrustifyCheck\uncrustify.cfg -F - --replace --no-backup --if-changed

OvmfPkg Example:

     git ls-files OvmfPkg/*.c OvmfPkg/*.h :!BaseTools/* | 
.pytool\Plugin\UncrustifyCheck\mu-uncrustify-release_extdep\Windows-x86\uncrustify.exe
 -c .pytool\Plugin\UncrustifyCheck\uncrustify.cfg -F - --replace --no-backup 
--if-changed



Thanks for the detail, I just did a pull and now I see the uncrustify cfg files. I followed your above command on my Ubuntu desktop and getting the below unknown symbol, is this a known issue ?


brijesh@sbrijesh-desktop:~/workdir/snp-edk2$ git ls-files OvmfPkg/Sec/AmdSev.c | uncrustify -c .pytool/Plugin/UncrustifyCheck/uncrustify.cfg -F - --replace --no-backup --if-changed .pytool/Plugin/UncrustifyCheck/uncrustify.cfg:73: unknown symbol 'nl_func_call_args_multi_line_ignore_closures' .pytool/Plugin/UncrustifyCheck/uncrustify.cfg:79: unknown symbol 'indent_func_call_edk2_style' .pytool/Plugin/UncrustifyCheck/uncrustify.cfg:120: unknown symbol 'sp_do_brace_open' .pytool/Plugin/UncrustifyCheck/uncrustify.cfg:134: unknown symbol 'sp_before_vardef_square' .pytool/Plugin/UncrustifyCheck/uncrustify.cfg:178: unknown symbol 'sp_brace_close_while' .pytool/Plugin/UncrustifyCheck/uncrustify.cfg:184: unknown symbol 'sp_before_square_asm_block' .pytool/Plugin/UncrustifyCheck/uncrustify.cfg:205: unknown symbol 'sp_while_paren_open' .pytool/Plugin/UncrustifyCheck/uncrustify.cfg:229: unknown symbol 'indent_func_def_param_paren_pos_threshold' .pytool/Plugin/UncrustifyCheck/uncrustify.cfg:270: unknown symbol 'align_edk2_style' .pytool/Plugin/UncrustifyCheck/uncrustify.cfg:323: unknown symbol 'cmt_align_doxygen_javadoc_tags' .pytool/Plugin/UncrustifyCheck/uncrustify.cfg:406: unknown symbol 'nl_before_whole_file_ifdef'
Parsing: OvmfPkg/Sec/AmdSev.c as language C
brijesh@sbrijesh-desktop:~/workdir/snp-edk2$
brijesh@sbrijesh-desktop:~/workdir/snp-edk2$ uncrustify --version
Uncrustify-0.69.0_f

I did submitted PR after above uncurstify run but the CI still didn't like it. Do we need to have specific version of uncrustify ?

-Brijesh

You do have to use the .pytool stuart commands to setup your environment so 
uncrustify tool is installed automatically.
This also allows you to run all the EDK II CI tests locally if you want to 
check and fix issues before
submitting a PR.

     
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftianocore%2Fedk2%2Fblob%2Fmaster%2F.pytool%2FReadme.md%23running-ci-locally&amp;data=04%7C01%7Cbrijesh.singh%40amd.com%7Cb303a189de3446c5c52108d9b9c4e760%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637745077634999978%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=OnGmCqMIEwmrZmn48M6MwErLyB60ORfN7CUceS%2BhPmI%3D&amp;reserved=0

You can also use git filter-branch to uncrustify a more complex patch series.  
That is in the email thread
and will be included in the Wiki.

Best regards,

Mike

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Michael Kubacki
Sent: Tuesday, December 7, 2021 12:50 PM
To: devel@edk2.groups.io; brijesh.si...@amd.com
Subject: Re: [edk2-devel] EDK2 CI build error "Uncrustify Coding Standard"

Hi Brijesh,

A Tianocore wiki article is being prepared but the background and
instructions for what to do were sent in this mail regarding the hard
freeze being lifted - 
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fedk2.groups.io%2Fg%2Fdevel%2Fmessage%2F84458&amp;data=04%7C01%7Cbrijesh.singh%40amd.com%7Cb303a189de3446c5c52108d9b9c4e760%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637745077635009974%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=LRtAPIFef6zlz6x0YNqpM9Hn5WIjFP1C0moMZFO9TWA%3D&amp;reserved=0.

Do you have questions after reading through that?

Thanks,
Michael

On 12/7/2021 2:52 PM, Brijesh Singh via groups.io wrote:
Hi All,

I am rebasing the SNP series and encountering the error like below from
the CI. I am not sure what I am missing. For testing purpose, I just
tried one commit and CI Windows build complains about this. This is the
same patch which passed all the CI. Any idea what I maybe missing ?


WARNING - A file header template is not specified in the config file.
WARNING - A function header template is not specified in the config file.
ERROR - /home/vsts/work/1/s/OvmfPkg/Sec/AmdSev.c
ERROR - /home/vsts/work/1/s/OvmfPkg/Sec/AmdSev.h
ERROR - --->Test Failed: Uncrustify Coding Standard Test NO-TARGET
returned 2


My patch does add the two files and they are listed in .inf.

-Brijesh











-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#84505): https://edk2.groups.io/g/devel/message/84505
Mute This Topic: https://groups.io/mt/87573134/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to