Skip to content

[clang-format]: ColumnLimit as one option, should not contain two different rules #58417

Open
@scruel

Description

@scruel

IMO, ColumnLimit should only do its literal rule, just like max_line_length in .editorconfig.
For respecting the input's line breaking decisions, I think we can consider provide a new option called RespectExistLineBreaks to do the ColumnLimit: 0 job?
Because I want clang-format to respect the line breaks I wrote, but keep breaking too long lines (contradict other rules).

Furthermore, can consider just deprecate the ColumnLimit option, and replace it by two options called maxLineLength: [int] and RespectExistLineBreaks: [boolean] will be better:

  /// This option is deprecated. See MaxLineLength and RespectExistLineBreaks.
  /// \version 3.7
  unsigned ColumnLimit;
  
  /// The max line length.
  ///
  /// Forces hard line wrapping after the amount of characters specified.
  /// \version <release-version>
  bool MaxLineLength;

  /// If ``true`` clang-format will respect the input's line breaking decisions
  /// within statements unless they contradict other rules.
  /// \version <release-version>
  bool RespectExistLineBreaks;

Might related to:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions