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

Proposed breaking changes for Mapperly 4.0 #1131

Open
latonz opened this issue Feb 23, 2024 · 4 comments
Open

Proposed breaking changes for Mapperly 4.0 #1131

latonz opened this issue Feb 23, 2024 · 4 comments

Comments

@latonz
Copy link
Contributor

latonz commented Feb 23, 2024

A list of proposed breaking changes for Mapperly 4.0:
To be discussed, if a particular change on the list leads to major discussions, we should create a separate issue.

  1. Strict Mappings by default (level warning)
    1.1. Change the default severity of RMG012: Source member was not found for target member to Warning
    1.2. Change the default severity of RMG020: Source member is not mapped to any target member to Warning
    1.3. Change the default severity of RMG037: An enum member could not be found on the source enum to Warning
    1.4. Change the default severity of RMG038: An enum member could not be found on the target enum to Warning
  2. Replace MapPropertyAttribute.ctor(string[], string[]) with MapPropertyAttribute.ctor(string, string[]) and MapPropertyAttribute.ctor(string[], string) since member paths are only supported on one side by Mapperly
  3. Change the default of MapperAttribute.AutoUserMappings to false.
  4. Change the default of MapperAttribute.PreferParameterlessConstructors to false
  5. Change the default severity of RMG060: Multiple user mappings discovered without specifying an explicit default to Error (requires MapperAttribute.AutoUserMappings default to false due to Before/After-Map).
@wrestlerdude
Copy link

What is the justification of no. 3?

@latonz
Copy link
Contributor Author

latonz commented May 3, 2024

@wrestlerdude the idea is to get to a more explicit API and prevent accidental / non-intuitive use of a mapping method by Mapperly.

@devtekve
Copy link
Sponsor

devtekve commented May 6, 2024

Why do you consider changing the severity to Warning a breaking change on no. 1? Am I missing something? 🤔

@latonz
Copy link
Contributor Author

latonz commented May 6, 2024

It is not really a breaking change, but we decided to postpone this change to the next major release since it may still need adjustments by all users that have TreatWarningsAsErrors enabled (which AFAIK is quite common).

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

3 participants