Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use types instead of records #51

Open
maco opened this issue Jan 18, 2023 · 0 comments
Open

Use types instead of records #51

maco opened this issue Jan 18, 2023 · 0 comments

Comments

@maco
Copy link
Collaborator

maco commented Jan 18, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant