Skip to content

Latest commit

 

History

History
42 lines (30 loc) · 2.31 KB

CrazyMultilineString.md

File metadata and controls

42 lines (30 loc) · 2.31 KB

Crazy multiline literals (CrazyMultilineString)

Type Scope Severity Activated
by default
Minutes
to fix
Tags
Code smell BSL
OS
Major Yes 1 badpractice
suspicious
unpredictable

Description

In source text, multi-line constants can be initialized in two ways:

  • 'classic', which uses line feed and string concatenation
  • 'crazy' where lines are separated by whitespace

The second method complicates the perception; when using it, it is easy to make and miss a mistake.

Examples

Sources

Snippets

Diagnostic ignorance in code

// BSLLS:CrazyMultilineString-off
// BSLLS:CrazyMultilineString-on

Parameter for config

"CrazyMultilineString": false