================
@@ -0,0 +1,32 @@
+.. title:: clang-tidy - readability-constant-operand-order
+
+readability-constant-operand-order
+==================================
+
+Warns when a constant appears on the non-preferred side of a supported binary
+operator and offers a fix-it to swap operands (and invert the operator for
+``<``, ``>``, ``<=``, ``>=``).
+
+Examples
+--------
+
+.. code-block:: c++
+
+  // Before
+  if (nullptr == p) { /* ... */ }
+  if (0 < x) { /* ... */ }
+
+  // After
+  if (p == nullptr) { /* ... */ }
+  if (x > 0) { /* ... */ }
+
+Options
+-------
+
+.. option:: PreferredConstantSide (string)
+
+   Either ``Left`` or ``Right``. Default: ``Right``.
----------------
EugeneZelenko wrote:

```suggestion
   Either `Left` or `Right`. Default: `Right`.
```

Lowercase?

https://github.com/llvm/llvm-project/pull/167158
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to