From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mx.groups.io with SMTP id smtpd.web11.31012.1590742511353905142 for ; Fri, 29 May 2020 01:55:11 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.120, mailfrom: shenglei.zhang@intel.com) IronPort-SDR: nnuMLKYkulVGRGuGl7hTXHEECWjlLFGtAWpKz5mBXPm/ukzFI3+iwY8najWfuHAxNMjmByICPc EusM5bprV8xw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 May 2020 01:55:10 -0700 IronPort-SDR: AWa2YVqXqpcaWeT5tT5gdxpbDo9jW+DGvvHaYFS+aQknKqa8hpRbnVF6EGA22AOp35/lXy6i7I lD772GaYriJA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,448,1583222400"; d="scan'208";a="256036855" Received: from shenglei-dev.ccr.corp.intel.com ([10.239.158.52]) by fmsmga007.fm.intel.com with ESMTP; 29 May 2020 01:55:08 -0700 From: "Zhang, Shenglei" To: devel@edk2.groups.io Cc: Bob Feng , Bret Barkelew , Michael D Kinney , Liming Gao , Sean Brogan Subject: [PATCH 0/5] Add a pipline to check Ecc issues for edk2 on open ci Date: Fri, 29 May 2020 16:54:59 +0800 Message-Id: <20200529085504.13972-1-shenglei.zhang@intel.com> X-Mailer: git-send-email 2.18.0.windows.1 REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2606 As planed we will enable Ecc check for edk2 on open ci. And they are ready now, but these are V1 series. So I expect that contributors in edk2 community can try using this script when reviewing. And I hope receiving feedback and comments if someone find errors or false positive issues. I created a pipline of EccCheck for my forked edk2. https://dev.azure.com/shengleizhang/shengleizhang/_build?definitionId=10&_a=summary Patches 1/5: This is a patch to enable python 3.8 for Ecc. It is a tool issues not a pipline or script issue. But it is listed here for people willing to try this tool. 2/5: EccCheck.py is a tool to report Ecc issues for commits. It can be run on azure servers for open ci, or locally. Its usage is like PatchCheck.py. 3/5: It's a lib necessary for py3 to run Ecc on azure servers. For local use, we need to type command "py -3 -m pip install antlr4-python3-runtime" first. 4/5: Windows-EccCheck.yml is a yaml file to configure the newly added pipline. The azure uses this to create a pipline. 5/5: We consider some cases that will report out Ecc issues but they won't be fixed, like submodule and industry standard related things. So we add two configuration fields "Exception" and "IgnoreFiles" for people to use. The patch is a example and the contents in the fields will be empty in final version. Note: For now this pipline can't report out Ecc issues like Tab character and trailing white spaceLine. And above issues are listed in CSV file after Ecc scanning traget files. But PatchCheck.py can report out them. I wonder whether we need to enable the above mentioned check points in this pipline, becaue either pipline fails, the commit will not be checked in. Cc: Bob Feng Cc: Bret Barkelew Cc: Michael D Kinney Cc: Liming Gao Cc: Sean Brogan Fan, Zhiju (1): BaseTools:ECC needs to update the contents of CParser4 Shenglei Zhang (4): BaseTools/Scripts: Add EccCheck.py pip-requirements.txt: Add Ecc required lib .azurepiplines: Add a pipline to check ECC issues for commits MdeModulePkg/MdeModulePkg.ci.yaml: Add configuration for Ecc check .azurepipelines/Windows-EccCheck.yml | 38 ++ BaseTools/Scripts/EccCheck.py | 426 ++++++++++++++++++ .../Source/Python/Ecc/CParser4/CLexer.py | 6 +- .../Source/Python/Ecc/CParser4/CListener.py | 4 +- .../Source/Python/Ecc/CParser4/CParser.py | 38 +- MdeModulePkg/MdeModulePkg.ci.yaml | 8 + pip-requirements.txt | 1 + 7 files changed, 498 insertions(+), 23 deletions(-) create mode 100644 .azurepipelines/Windows-EccCheck.yml create mode 100644 BaseTools/Scripts/EccCheck.py -- 2.18.0.windows.1