Skip to content

Use types instead of records #51

@maco

Description

@maco

rebar3_typer version

0.0.1

OS version

Mac 12.6.2

Description

  • Motivation
    Elvis's default config recommends defining types for records and using those in type specs.
  • Proposal
    Automatically use types in place of records if they exist.

Bonus: if the corresponding type doesn't exist yet, add it.

Current behavior

Although a type was already defined for the record, TypEr generated specs with the records instead of using the existing type.

  - no_spec_with_records (https://github.com/inaka/elvis_core/tree/main/doc_rules/elvis_style/no_spec_with_records.md)
    - The spec in line 63 uses a record, please define a type for the record and use that instead.
    - The spec in line 78 uses a record, please define a type for the record and use that instead.
    - The spec in line 117 uses a record, please define a type for the record and use that instead.
    - The spec in line 356 uses a record, please define a type for the record and use that instead.

Expected behavior

Use the corresponding type instead of the record. (Don't generate this error from Elvis.)

Config

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions