tianocore / edk2

EDK II
https://github.com/tianocore/tianocore.github.io/wiki/EDK-II
Other
4.38k stars 2.4k forks source link

BaseTools: Allow ascii exceptions for ECC #5867

Open leiflindholm opened 5 days ago

leiflindholm commented 5 days ago

As part of trying to merge https://github.com/tianocore/edk2/pull/5840, I realised ECC was not respecting the new exception I added to EmbeddedPkg in order to pass CI.

So I did some digging in ECC, and first of all found "ascii" was consistently misspelt throughout, so first a patch to fix that.

But then I also found it bails if it finds any non-7-bit characters without even looking at the exceptions. So I added support for checking the exception list. As part of that, the error reporting drops to one report per line.

I don't tend to write much python, and I'm sure someone who does could do it more cleanly. Feedback very welcome.

@mariobalanica @mdkinney @makubacki

mdkinney commented 4 hours ago

If non-ASCII is required in a source file comment, then we need to decide the file format and encodings supported and we need to make sure every tool that may open a source file is compatible with that encoding. I know over the years, we have had both commercial tools and custom tools that would fail if the source file type was not ASCII. Compilers, static analysis, document generators, and statistics collection are just a few examples of the types of tools that open/read source files. We also have to make sure all the editors that the community is using supports the select file type/encodings.