From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (NAM11-DM6-obe.outbound.protection.outlook.com [40.92.19.53]) by mx.groups.io with SMTP id smtpd.web10.4616.1639008502690992587 for ; Wed, 08 Dec 2021 16:08:23 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@outlook.com header.s=selector1 header.b=Zsl1R40Z; spf=pass (domain: outlook.com, ip: 40.92.19.53, mailfrom: michael.kubacki@outlook.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cNZG3agFb/k//R32k9cRjAlANWS1fP/rMsY4SRIlBkyVPjciEnrzzWGg9L2Ka/CUrf0f8H9ux2vh5US1p3BwhngIuDmpbIUgaWyxFE+q4w1DE5F0qq6XLOFnSeKydoXyeUw7cu+fMlLATwRcd8byP+ixsCpxvY4w3wVD/+h5Rkn3sxzOrjvzlGkr8NubRGlED8Bg8i9gIedN7d3GoaHrTWvtk5BMv5DsEvEremkMdVtZ8OTa1B+5FEerBdPmTDAV+feFdGPkYZ6Jgt1Wie0RPQ6Xa6klPJYN/eujBWvPw/UYWOE+h9Z09xIQsyeXtIY2BZDMCHOb1nY6CyazZB/9vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=yRUc7VyIL3B72j8RQYGOwojmT3nHVbzP8DZCbAdbYRo=; b=LKjmmBUtnLWDz6C6vOGbfGECAxHlznAC8tPvkmppSFS96ZQgpr3tFKQKyaeix6kajxsmTs4UB+6NdH9F2PP4obxFLkE6mTICM3Qzm25S86lJ3olWgsLv2VIri6aFU/LcBN40xTgXeSNVjXeaZxvzxLHdW0qyvqzpHyzw4G/u+hg/D2xYiaiLIB8fwnH0ZQYvrUXLlwjLB+SooIF4Hlcgn2U/T6Pw1PVq6S1F28KVMxAIxc9sew5RG0w+3AygyMEGX0X0C1zOlRqXpeydFNYvjEo0dVeNVEvhIeZqrZVn8t2beqc04jinuOiad43rZ7sNNwy9ij/ZQPTok40nqdzrsw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yRUc7VyIL3B72j8RQYGOwojmT3nHVbzP8DZCbAdbYRo=; b=Zsl1R40ZUipeVtxyNGAtgRAZzH4T28+0D/YlwK2+YZVbJutNjsPRVoa2onlyqe03rRWNHgh6uPaNM9duzJQdgVFXVO7Mxp5/YR2s2XynbUlkEqLbvwU3Ya6OTThTJCcGqMUuJUv6yH7Ip3l30Rlh2WakACywwyOOG7CTsa5gpWayTAhnh3z9RDsBDDN2PXCJQ2ntufquvVAa95iz84VXHXjyEN/kATBna3CJj7oIJg1muWFPdZCZiENEukq3TxI/x2zom30XSjdG/ERd50yWjn8EFRxHXl7vP5zCvWTclogvUG4qPn0fYFFbRTJOQmozYQlfGv+gjn0gw1mMfafpZg== Received: from MWHPR07MB3440.namprd07.prod.outlook.com (2603:10b6:301:69::28) by MWHPR07MB2797.namprd07.prod.outlook.com (2603:10b6:300:1d::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4778.12; Thu, 9 Dec 2021 00:08:21 +0000 Received: from MWHPR07MB3440.namprd07.prod.outlook.com ([fe80::75d8:b961:c6c3:e97e]) by MWHPR07MB3440.namprd07.prod.outlook.com ([fe80::75d8:b961:c6c3:e97e%6]) with mapi id 15.20.4755.022; Thu, 9 Dec 2021 00:08:21 +0000 From: "Michael Kubacki" To: devel@edk2.groups.io CC: Andrew Fish , Leif Lindholm , Michael D Kinney , Liming Gao Subject: [edk2-wiki][PATCH v2 1/1] Add Uncrustify formatting overview Date: Wed, 8 Dec 2021 19:07:57 -0500 Message-ID: X-Mailer: git-send-email 2.28.0.windows.1 X-TMN: [GjDXfcaDtlHS+qarnWNJyrqE13ipeCQ1Es3l2LSkeo8p9hnMYPjFBwNKi0hm5wOs] X-ClientProxiedBy: BN8PR03CA0013.namprd03.prod.outlook.com (2603:10b6:408:94::26) To MWHPR07MB3440.namprd07.prod.outlook.com (2603:10b6:301:69::28) Return-Path: michael.kubacki@outlook.com X-Microsoft-Original-Message-ID: <20211209000757.3064-1-michael.kubacki@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (2601:703:0:bb0:e068:da31:bb80:7b48) by BN8PR03CA0013.namprd03.prod.outlook.com (2603:10b6:408:94::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.20 via Frontend Transport; Thu, 9 Dec 2021 00:08:19 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a1bddbb2-f747-443f-0fc5-08d9baa8024b X-MS-TrafficTypeDiagnostic: MWHPR07MB2797:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uhjzYjBIlaH96QvJHNbvVFwziU8MPMeieY9tq4rr8Fl3vrA55FVMnzYu5KoQqbT4BNTOhw46lHvH5rlYaL5d1YTsCtmLWoI4FD+L2f20ItI6hs+kNrY0EQvzskrNGb2WEg31zT9m9pBIWRm6ke2yxBeSgoVwOp60o/EbhQFGvfvAGe+kp7dgcpOEF7i5TeFQ2j2GAK8dRaQMVIySoOvIIdWwKHNQQDFlABKtuteC8py74E7wTn8Pqjyo8G6voUUFPb28WRW62Y1hqN8b1jE8AxXiQQc7vHFUAAwNeTXPQwJ+XOAiFIF0DImAXeEwBkk2bIxJTp3e+u+zZY2+OkXUB0NQGNOBniI/JWV4IeGQs2wKIPe4KYoUTaf0upq1dVMT6NFIjPzlSpyPzQnZacOS1XLBYcaIasxsxMrkOF+zrXrwllFGeWOIAfYgFqYOoRzo8lwmYnTk1eE90KgGoAqflhvVU57KRZo0hy3pKkATqriFf09ftiQeyRqB4UCSsWIFWjZkhTD/+0SYbtex9xtZfO0T8d+op7PHY/gKsh0kqZyv5C2mnPQB+Ssc+uzl2yaT/d6PGpf/SkriQSaxhrgn0R26Qx53Njw8/Mzy2eEe7Ojjxx+Rn5BMh9Xd9ODtD+iYXRitCZ/wCmZ1S9mvJYXIQ9Aq9catV9fxVZsJtWrUrz8= X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?WdZ4Fs9avz5jNz6f5XP61HJdO2Vmq0xe3MSrqdRTo62Nq44Hq0U6n3oCNXt7?= =?us-ascii?Q?RkW+g5VdsfR8hrXnsBAx1nuklRmTdX5WOaKMZ91I+/LrkTniyU5YBBybWrwZ?= =?us-ascii?Q?/jxgvC+fz5PP7fauQMK2XHbzPitqT0fQEyv+qFXxj/tszcViWUX3gOftKmhr?= =?us-ascii?Q?UBvWSrSs+yHguOLmnrFME09+mqSsqmicnRNEzkfWq+iA6m6UMpzYmFqVymdi?= =?us-ascii?Q?8qbO1JkqWQqwLBznPmITbYxr01NohU/NE5lBPsAvVTorF6uYCjQxP/FZ0OkM?= =?us-ascii?Q?kJfn3hgD/rbx+srRbpRFzY4Ve2XaFS6wbnDe8z7LKlKYwnkusXKVO9x9vZzx?= =?us-ascii?Q?SGHp82qGAiPhK/1WJUcSPvmiVDxWrmUj+gby+mVcycfDu91vb3HVbXmnwyoe?= =?us-ascii?Q?QvZCjCa056NulfbaIC8VwYHWtqKdYeULj1/XNx+aiDyglGUxtUFzh2bcpodY?= =?us-ascii?Q?iqklys+sRgbv2fZmkaOLZbX6dhj7qB0mBf6GbDtHJHVYNt/Ka04HoVSIBUx8?= =?us-ascii?Q?9waJ1cIdd6JpICC+XRKQ6rpm37MZSPFdnK5zwifcWjYM10Kx6/v9PJrdXGjw?= =?us-ascii?Q?yhDO5nRnKB/M/JzKgtoz2savBG9wpqw7haKePV3oe3RNPRYIg3lidBoJn6cg?= =?us-ascii?Q?zh3ImRUYVGn+AGoXAHL+pNOq2uun7qgKhJdMHcwT6MwWczc7rmPkkORkwZYU?= =?us-ascii?Q?lrUsoHAHbJ3fue/ys3G2puigrqws8j6RUPL/sLpIgisTcmHYeFQKbstOxaZ6?= =?us-ascii?Q?redSSmspVBL14OABxZ2abQcphRdfBHuNEh1ZO6dOBQfQGybqo6wdU86y1g7n?= =?us-ascii?Q?nr/to5NfapBMYyy4M/p/Tet9lLsyXA7vyvtcXhZF2qsSXdqb7sCBebKvAoGT?= =?us-ascii?Q?lHz685YuuC4Ic1LUVMp9Cjkh2tMNP5KMUIYEEECzbiRTD6Excl37Bn10LboR?= =?us-ascii?Q?XGpCS5mYAUdSpp+BNmqBhNCG50TGNEa8Mg6RQml+ZcwAr2GK01+DFBWZGoAr?= =?us-ascii?Q?vBYqS7rnOarjIie4RriiLjK2JA=3D=3D?= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a1bddbb2-f747-443f-0fc5-08d9baa8024b X-MS-Exchange-CrossTenant-AuthSource: MWHPR07MB3440.namprd07.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Dec 2021 00:08:21.1318 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR07MB2797 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain From: Michael Kubacki This wiki page describes how Uncrustify is used in EDK II and how to install and use Uncrustify during the EDK II code development process. Cc: Andrew Fish Cc: Leif Lindholm Cc: Michael D Kinney Cc: Liming Gao Signed-off-by: Michael Kubacki --- Notes: v2 changes: =20 - Add UncrustifyCheck CI plugin readme and config file links - Update manual usage instructions to include Linux instructions - Clean up manual usage instructions - Minor formatting changes EDK-II-Code-Formatting.md | 247 ++++++++++++++++++++ 1 file changed, 247 insertions(+) diff --git a/EDK-II-Code-Formatting.md b/EDK-II-Code-Formatting.md new file mode 100644 index 000000000000..e671663e5dcd --- /dev/null +++ b/EDK-II-Code-Formatting.md @@ -0,0 +1,247 @@ +# EDK II Code Formatting + +To better achieve the goals of the [EDK II C Coding Standards Specificatio= n](https://edk2-docs.gitbook.io/edk-ii-c-coding-standards-specification/), +EDK II code formatting is automated using a source code beautifier called = Uncrustify. Uncrustify is compatible with +C/C++ in addition to other languages. In EDK II, it is used to format C la= nguage source code. + +## Uncrustify in the edk2 Repository + +The Uncrustify collateral in the edk2 repository contains all of the resou= rces needed to get the Uncrustify application +and run it with the same settings as other developers. + +> Uncrustify is automatically run against code submitted in edk2 as a cont= inuous integration (CI) plugin called +"UncrustifyCheck". The plugin is available in the following directory: +[.pytool/Plugin/UncrustifyCheck](https://github.com/tianocore/edk2/tree/ma= ster/.pytool/Plugin/UncrustifyCheck) + +The UncrustifyCheck plugin in edk2 contains the following files used to ch= eck code for compliance to the coding +standard: + +* **default_file_header.txt** - A text file containing a template that is = placed at the top of files missing a file + header. +* **default_function_header.txt** - A text file containing a template that= is placed above functions that are missing + a function header. +* **Readme.md** - A file that contains details about how the plugin works = and how to use it. +* **uncrustify_ext_dep.yml** - An "external dependency" file that is used = to get the current version of the Uncrustify + application used by the plugin. This file contains the NuGet feed URL an= d the version currently used. +* **uncrustify_plug_in.yaml** - A file that contains information to descri= be the plugin to the build environment. +* **uncrustify.cfg** - A file used by the Uncrustify application to contro= l how it formats code. If you want to tweak + particular formatting details, this is the place to start. +* **UncrustifyCheck.py** - The actual Python file that is the CI plugin. L= ike all CI plugins, this plugin can be run + in local CI and server CI. + +## EDK II Uncrustify Fork + +Due to nuances in the way EDK II formats code, some changes were made to t= he upstream Uncrustify application. These +were changes that could not be made purely through the Uncrustify configur= ation file. For more details about the fork, +please visit that project overview in the link below. + +* Uncrustify upstream repository: https://github.com/uncrustify/uncrustify +* Uncrustify EDK II fork repository (in Project Mu): https://dev.azure.com= /projectmu/Uncrustify + +## Developer Workflow + +Developers must install Uncrustify and run the application against their c= ode before sending patch review emails or +submitting pull requests. Pull requests run against EDK II CI which includ= es the UncrustifyCheck CI plugin. + +Fortunately, Uncrustify can be installed quickly, you can format your code= quickly locally, and you can verify the +code against the UncrustifyCheck CI plugin before sending it to others. + +The recommended flow is: + +1. Clone the edk2 source code repository +2. Use the `stuart*` commands to pull the Uncrustify application into the = edk2 workspace +3. Set up the ability to run Uncrustify locally (for example, using the Vi= sual Studio Code Uncrustify plugin) +4. Make and test code changes +5. Run EDK II CI locally to verify UncrustifyCheck passes +6. Send the code patch to the EDK II mailing list + +## Installing Uncrustify + +Uncrustify is a portable executable that is built in the [EDK II Uncrustif= y fork repository](https://dev.azure.com/projectmu/Uncrustify) +and ultimately published into a NuGet feed in that fork project. + +### Recommended Installation: In edk2 repository + +It is strongly recommended to follow this flow. It sets up the workspace t= o work with local CI and automatically gets +the current supported version of the application. + +The Uncrustify tool is installed automatically when the Pytools environmen= t is used and the `stuart*` commands are run +to complete environment setup. Review the edk2 [.pytool/Readme.md](https:/= /github.com/tianocore/edk2/tree/master/.pytool#running-ci-locally) +file for details on `stuart` and this overall flow. + +After running the `stuart_update` command, the Uncrustify application cont= ent should be brought down into +`.pytool\Plugin\UncrustifyCheck\mu-uncrustify-release_extdep` in your edk2= workspace. The contents of this directory +now represent the contents of the NuGet package and it should contain a Li= nux and Windows executable of the +application. + +### Manual Installation: Download from the fork project + +The release pipeline in the EDK II Uncrustify fork project contains the bu= ild information for each release. Each build +in this pipeline represents a release. By going to a specific build, the d= etails mapping the build to source code +(such as the branch and commit) are present. + +The build content is published as a NuGet package to a NuGet feed. This is= the same feed, the recommended installation +instructions automatically pull from. The NuGet feed is available in the [= "Artifacts"](https://dev.azure.com/projectmu/Uncrustify/_packaging?_a=3Dfee= d&feed=3Dmu_uncrustify) +section of the fork project. If you hover/click on a specific package entr= y (e.g. "mu-uncrustify-release"), a set of +three ellipsis will appear. Click the ellipsis and a context menu will app= ear. The NuGet package can be downloaded +by clicking "Download \". + +Once downloaded, the `.nupkg` file can be treated as a zip file. If the fi= le is opened as a zip file, the executable +can be found in the `mu-uncrustify-` directory. + +## How to Run Uncrustify + +Once Uncrustify is installed, you can run the application in a number of w= ays. In all cases, you should be using the +Uncrustify application built from the [Uncrustify EDK II fork](https://dev= .azure.com/projectmu/Uncrustify) and the +[Uncrustify configuration file](https://github.com/tianocore/edk2/blob/mas= ter/.pytool/Plugin/UncrustifyCheck/uncrustify.cfg) +currently checked into edk2. + +### Recommended Usage: Visual Studio (VS) Code Plugin + +The Visual Studio Code plugin provides a way to seamlessly run Uncrustify = against code at anytime in the editor and +the configuration details are set once in the editor configuration file. + +1. Install the Uncrustify VS Code extension: + > Name: Uncrustify + Id: zachflower.uncrustify + Description: Code format using uncrustify + Publisher: Zachary Flower + VS Marketplace Link: + +2. Configure the Uncrustify plugin for your local setup by adding the foll= owing to your VS Code settings.json file: + (Windows example) + + ```json + "uncrustify.configPath.windows": "path_to_your_config_file", + "uncrustify.executablePath.windows": "path_to_your_uncrustify_executabl= e" + ``` + + > Windows Example: + > + >```json + >"uncrustify.configPath.windows": "D:/src/edk2/.pytool/Plugin/Uncrustif= yCheck/uncrustify.cfg", + >"uncrustify.executablePath.windows": "D:/src/edk2/.pytool/Plugin/Uncru= stifyCheck/mu-uncrustify-release_extdep/Windows-x86/uncrustify.exe" + >``` + +3. Open a C source code file, _`Ctrl+Shift+P` -> Format Document With... -= > Configure Default Formatter -> Uncrustify_ + +4. Then, _`Ctrl+Shift+P` -> Format Document_ any time you would like to fo= rmat your source code file with Uncrustify + +### Manual Usage: Run in a Terminal + +These instructions are written for Windows 10. These activities could be f= urther automated into a high-level script +but that has not been done yet. + +1. Generate a list of the files to run against. This example generates a r= ecursive list of all .c and .h files. + + * It is recommended to run this in cleanly cloned edk2 repo without sub= modules to prevent submodule files + (such as Brotli files in MdeModulePkg) from getting included in the f= ile list (if you are running against all + files). Including all files will significantly increase the amount of= time Uncrustify takes to run. + + * Sample Powershell command to recursively write all .c and .h files in= a given package to a text file: + + ```powershell + Get-ChildItem -Path .\MdePkg\* -Include *.c, *.h -Recurse -Force | %{= $_.fullname} | Out-File + -FilePath .\MdePkgFiles.txt -Encoding utf8 + ``` + + > **WARNING** Powershell will put the UTF-8 BOM at the beginning of the= output file. Uncrustify does not recognize the BOM + and it should be removed before passing the file as input to Uncrustify= . If it is not removed, Uncrustify will + not read the first file path in the text file properly which will cause= the file to not be formatted. + +2. Run Uncrustify using the generated text file as input + + The following assume you move the EDK II Uncrustify configuration file = to the directory .uncrustify in your edk2 + workspace. + + ```shell + uncrustify.exe -c .\.pytool\Plugin\UncrustifyCheck\uncrustify.cfg -F Md= ePkgFiles.txt --replace --no-backup --if-changed + ``` + + > *Note:* When testing a configuration change, it is sometimes useful t= o run Uncrustify against a particular file + and check the debug output to understand what rule was applied and wh= y it was applied. The command shows an + example of how to run the configuration file `uncrustify.cfg` against= the source file `VariableSmm.c` where the + file is forced to be treated as C, the debug output is written to `un= crustify_debug.txt` and the log severity level + is set to "all". + + ```shell + uncrustify.exe -c .\.pytool\Plugin\UncrustifyCheck\uncrustify.cfg -f .\= MdeModulePkg\Universal\Variable\RuntimeDxe\VariableSmm.c -o output.c -l C -= p uncrustify_debug.txt -L A 2>verbose_debug.txt + ``` + +Uncrustify will update the source files in-place (with the commands given)= . This allows you to diff the results with +git. From here, you can iteratively tweak the configuration file and check= the results until your satisfied with the +outcome. + +## Uncrustify in CI + +The UncrustifyCheck CI plugin that will verify formatting on the server ca= n be run locally. It is recommended to run +local CI to verify the patch submission will pass CI on the server. + +This can be done using the `stuart_ci_build` command. + +> Tip: To quickly only run UncrustifyCheck, remove the other plugin direct= ories from your local `.pytool` directory + and, of course, add them back when you're done. + +Here's an example of running UncrustifyCheck against MdeModulePkg from the= root of an edk2 workspace: + +`stuart_ci_build -c .pytool/CISettings.py -p MdeModulePkg` + +If a file has a formatting error, it will be noted in the output from `stu= art_ci_build`. This is visible in the +terminal output in local CI and the build output log in server CI. + +Read the [UncrustifyCheck Readme.md](https://github.com/tianocore/edk2/blo= b/master/.pytool/Plugin/UncrustifyCheck/Readme.md) +to understand more about how the plugin can be configured for CI. + +## Extra Reading: Tracing History Across the Uncrustify Changes + +It might be helpful to view the entire history rewritten with Uncrustify f= ormatting on every commit. For example, an +alternate version of the edk2 repository that serves as "documentation" wi= th the entire history re-written. + +A tool called git-filter-repo can be used to perform this transformation a= nd runs in a reasonable period of time +(a few hours): + +* +* + +The following steps can be used to perform this transformation. This is th= e Windows process. A Linux process will be +added in the future. + + > **WARNING** This operation modifies (rewrites) all the commits in the= local copy of the repo. Do not perform + these steps on a local repo you are using for active deve= lopment. + +1. Clone edk2 into a new directory (see **WARNING**) + + ```shell + git clone https://github.com/tianocore/edk2.git edk2-uncrustified + cd edk2-uncrustified + ``` + +2. Setup python virtual env, install pytools, and run stuart commands to s= etup build environment which includes + installing uncrustify tools. See [Running CI Locally](https://github.co= m/tianocore/edk2/tree/master/.pytool#running-ci-locally). + +3. Make a backup copy of the plugin UncrustifyCheck outside WORKSPACE. (e.= g. C:\Temp\UncrustifyCheck) so the + Uncrustify executable and EDK II specific Uncrustify configuration file= are available when working with a branch + that does not have those tools in its scope. + + ```shell + xcopy .pytool\Plugin\UncrustifyCheck C:\Temp\UncrustifyCheck + ``` + +4. Use lint-history.py from git-filter-repo examples + + * [git-filter-repo](https://github.com/newren/git-filter-repo) + * [lint-history](https://github.com/newren/git-filter-repo/blob/main/co= ntrib/filter-repo-demos/lint-history) + +Line #127 - Add try except around subprocess.check_call() with except bein= g pass. This is required because there are a +few commits of C files in the edk2 repo that have incorrect C syntax and d= o not build with a C compiler and break the +Uncrustify parser. Skip reformat of C files that can not be parsed by uncr= ustify. These rare instances are addressed in +the commit that fixes the C syntax error. + +Run this slightly modified version of lint-history. Include only .c/.h fil= es and exclude directories that start with +`Tools` or `BaseTools`. This step took about 2.2 hours on a laptop. + +```shell +lint-history.py + --relevant "return (not filename.startswith(b'Tools') and not filename= .startswith(b'BaseTools') and (filename.endswith(b'.c') or filename.endswit= h(b'.h')))" + c:\\work\\GitHub\\tianocore\\foo\\UncrustifyCheck\\mu-uncrustify-relea= se_extdep\\Windows-x86\\uncrustify.exe -c c:\\work\\GitHub\\tianocore\\foo\= \UncrustifyCheck\\uncrustify.cfg --replace --no-backup --if-changed +``` --=20 2.28.0.windows.1