summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorZubin Duggal <zubin.duggal@gmail.com>2021-10-12 18:25:41 +0530
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-10-26 12:36:24 -0400
commit0255ef38b1bb0d4f3608bf92ebc8a93955ccb30a (patch)
tree718653d95e2d43388f6e20f7fa2057aee1282baf /docs
parent0f7541dc37d25d8a1056586bbeb57bf0dd2826a0 (diff)
downloadhaskell-0255ef38b1bb0d4f3608bf92ebc8a93955ccb30a.tar.gz
Warn if unicode bidirectional formatting characters are found in the source (#20263)
Diffstat (limited to 'docs')
-rw-r--r--docs/users_guide/using-warnings.rst18
1 files changed, 18 insertions, 0 deletions
diff --git a/docs/users_guide/using-warnings.rst b/docs/users_guide/using-warnings.rst
index 4cae76ec5a..8cdd5677fe 100644
--- a/docs/users_guide/using-warnings.rst
+++ b/docs/users_guide/using-warnings.rst
@@ -55,6 +55,7 @@ To reverse ``-Werror``, which makes all warnings into errors, use ``-Wwarn``.
* :ghc-flag:`-Wstar-binder`
* :ghc-flag:`-Woperator-whitespace-ext-conflict`
* :ghc-flag:`-Wambiguous-fields`
+ * :ghc-flag:`-Wunicode-bidirectional-format-characters`
The following flags are simple ways to select standard "packages" of warnings:
@@ -2169,6 +2170,23 @@ of ``-W(no-)*``.
This warning has no effect when :extension:`DuplicateRecordFields` is
disabled.
+.. ghc-flag:: -Wunicode-bidirectional-format-characters
+ :shortdesc: warn about the usage of unicode bidirectional layout override characters
+ :type: dynamic
+ :category:
+
+ Explicit unicode bidirectional formatting characters can cause source code
+ to be rendered misleadingly in many viewers. We warn if any such character
+ is present in the source.
+
+ Specifically, the characters disallowed by this warning
+ are those which are a part of the 'Explicit Formatting`
+ category of the `Unicode Bidirectional Character Type Listing
+ <https://www.unicode.org/reports/tr9/#Bidirectional_Character_Types>`_
+
+ :since: 9.0.2
+
+
If you're feeling really paranoid, the :ghc-flag:`-dcore-lint` option is a good choice.
It turns on heavyweight intra-pass sanity-checking within GHC. (It checks GHC's
sanity, not yours.)