Skip to content

Lint against tabs in doc comments #4623

Closed
@Lythenas

Description

@Lythenas

Mixing spaces and tabs is always a bad idea but for doc comments it's especially bad because the rendered output might be different when using tabs or spaces.

See #4622

The actual output is/was
image

But the output should be
image

The only difference is the indentation:

With tabs:

/// 		- Recommends a signed suffix, even though the number might be too big and an unsigned
///		suffix is required
/// 		- Does not match on `_128` since that is a valid grouping for decimal and octal numbers

(depending on your editor settings the suffix ... is aligned with the - or left of it)

With spaces (and without leading whitespace):

/// - Recommends a signed suffix, even though the number might be too big and an unsigned
///   suffix is required
/// - Does not match on `_128` since that is a valid grouping for decimal and octal numbers

I'm not sure if tabs should be linted in normal rust code too but IMO it is necessary in doc comments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintArea: New lintsL-styleLint: Belongs in the style lint groupgood first issueThese issues are a good way to get started with Clippy

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions