CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
62 lines
2.2 KiB
ReStructuredText
62 lines
2.2 KiB
ReStructuredText
.. title:: clang-tidy - modernize-raw-string-literal
|
|
|
|
modernize-raw-string-literal
|
|
============================
|
|
|
|
This check selectively replaces string literals containing escaped characters
|
|
with raw string literals.
|
|
|
|
Example:
|
|
|
|
.. code-block:: c++
|
|
|
|
const char *const Quotes{"embedded \"quotes\""};
|
|
const char *const Paragraph{"Line one.\nLine two.\nLine three.\n"};
|
|
const char *const SingleLine{"Single line.\n"};
|
|
const char *const TrailingSpace{"Look here -> \n"};
|
|
const char *const Tab{"One\tTwo\n"};
|
|
const char *const Bell{"Hello!\a And welcome!"};
|
|
const char *const Path{"C:\\Program Files\\Vendor\\Application.exe"};
|
|
const char *const RegEx{"\\w\\([a-z]\\)"};
|
|
|
|
becomes
|
|
|
|
.. code-block:: c++
|
|
|
|
const char *const Quotes{R"(embedded "quotes")"};
|
|
const char *const Paragraph{"Line one.\nLine two.\nLine three.\n"};
|
|
const char *const SingleLine{"Single line.\n"};
|
|
const char *const TrailingSpace{"Look here -> \n"};
|
|
const char *const Tab{"One\tTwo\n"};
|
|
const char *const Bell{"Hello!\a And welcome!"};
|
|
const char *const Path{R"(C:\Program Files\Vendor\Application.exe)"};
|
|
const char *const RegEx{R"(\w\([a-z]\))"};
|
|
|
|
The presence of any of the following escapes can cause the string to be
|
|
converted to a raw string literal: ``\\``, ``\'``, ``\"``, ``\?``,
|
|
and octal or hexadecimal escapes for printable ASCII characters.
|
|
|
|
A string literal containing only escaped newlines is a common way of
|
|
writing lines of text output. Introducing physical newlines with raw
|
|
string literals in this case is likely to impede readability. These
|
|
string literals are left unchanged.
|
|
|
|
An escaped horizontal tab, form feed, or vertical tab prevents the string
|
|
literal from being converted. The presence of a horizontal tab, form feed or
|
|
vertical tab in source code is not visually obvious.
|
|
|
|
Options
|
|
-------
|
|
|
|
.. option:: DelimiterStem
|
|
|
|
Custom delimiter to escape characters in raw string literals. It is used in
|
|
the following construction: ``R"stem_delimiter(contents)stem_delimiter"``.
|
|
The default value is `lit`.
|
|
|
|
.. option:: ReplaceShorterLiterals
|
|
|
|
Controls replacing shorter non-raw string literals with longer raw string
|
|
literals. Setting this option to `true` enables the replacement.
|
|
The default value is `false` (shorter literals are not replaced).
|