ci: disallow directional formatting
commit0e7696c64db78f698c40686d4869e2a8d0ab2696
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Thu, 4 Nov 2021 13:13:29 +0000 (4 13:13 +0000)
committerJunio C Hamano <gitster@pobox.com>
Thu, 4 Nov 2021 17:13:10 +0000 (4 10:13 -0700)
treef663bae2986e13618a6491e11fbeb38fcdd6e522
parentaf6d1d602a8f64164b266364339c4e936d5bbc33
ci: disallow directional formatting

As described in https://trojansource.codes/trojan-source.pdf, it is
possible to abuse directional formatting (a feature of Unicode) to
deceive human readers into interpreting code differently from compilers.

For example, an "if ()" expression could be enclosed in a comment, but
rendered as if it was outside of that comment. In effect, this could
fool a reviewer into misinterpreting the code flow as benign when it is
not.

It is highly unlikely that Git's source code wants to contain such
directional formatting in the first place, so let's just disallow it.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
.github/workflows/main.yml
ci/check-directional-formatting.bash [new file with mode: 0755]