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

feat : add mapper attribute PreferParameterlessConstructors #1061

Merged
merged 13 commits into from Jan 19, 2024

Conversation

R-abodyak
Copy link
Contributor

@R-abodyak R-abodyak commented Jan 13, 2024

add mapper attribute PreferParameterlessConstructors

Controls the priority of constructors used in mapping

When enabled, a parameterless constructor is prioritized over constructors with parameters. When disabled, accessible constructors are ordered in descending order by their parameter count.

Fixes #885

Checklist

  • The existing code style is followed
  • The commit message follows our guidelines
  • Performed a self-review of my code
  • Hard-to-understand areas of my code are commented
  • The documentation is updated (as applicable)
  • Unit tests are added/updated
  • Integration tests are added/updated (as applicable, especially if feature/bug depends on roslyn or framework version in use)

@R-abodyak R-abodyak changed the title add mapper attribute PreferParameterlessConstructors feat : add mapper attribute PreferParameterlessConstructors Jan 13, 2024
Copy link
Contributor

@latonz latonz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your first contribution to Mapperly! I added my feedback, feel free to discuss any points or ask questions.

@latonz
Copy link
Contributor

latonz commented Jan 14, 2024

The new public API can be added to the PublicAPI.Unshipped.txt file with the code-fix and then be moved to the PublicAPI.Shipped.txt file right away.

@R-abodyak R-abodyak requested a review from latonz January 14, 2024 20:27
Copy link

codecov bot commented Jan 15, 2024

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (cdee78b) 91.18% compared to head (3bf892b) 91.18%.

Files Patch % Lines
...apperly/Configuration/MapperConfigurationMerger.cs 75.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1061      +/-   ##
==========================================
- Coverage   91.18%   91.18%   -0.01%     
==========================================
  Files         220      220              
  Lines        7192     7203      +11     
  Branches      913      915       +2     
==========================================
+ Hits         6558     6568      +10     
  Misses        418      418              
- Partials      216      217       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@R-abodyak R-abodyak requested a review from latonz January 15, 2024 20:06
Copy link
Contributor

@latonz latonz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@R-abodyak
Copy link
Contributor Author

Hi @latonz , can you check them now ?
btw , is that something I can check locally or not ?

@latonz
Copy link
Contributor

latonz commented Jan 17, 2024

You can run the linters locally. Find the commands in the workflow files:

- run: dotnet tool restore
- run: dotnet csharpier --check .
# don't run dotnet format for whitespace formatting as this is done by csharpier
- run: dotnet format style --verify-no-changes
- run: dotnet format analyzers --verify-no-changes

- run: npm ci
working-directory: ./docs
- run: npm run lint
working-directory: ./docs
- run: npm run build
working-directory: ./docs

Since this is your first PR on this repo I need to approve each pipeline run manually. Further PR pipelines should run automatically.

for the docs you can usually simply run npm run fix in the docs directory.

latonz and others added 9 commits January 18, 2024 22:14
Bumps [Meziantou.Analyzer](https://github.com/meziantou/Meziantou.Analyzer) from 2.0.127 to 2.0.132.
- [Release notes](https://github.com/meziantou/Meziantou.Analyzer/releases)
- [Commits](meziantou/Meziantou.Analyzer@2.0.127...2.0.132)

---
updated-dependencies:
- dependency-name: Meziantou.Analyzer
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
riok#1049)

The value runtime already indicates the runtime meaning
…ok#1059)

Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.2 to 1.15.4.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](follow-redirects/follow-redirects@v1.15.2...v1.15.4)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@R-abodyak R-abodyak requested a review from latonz January 18, 2024 20:48
@latonz latonz enabled auto-merge (squash) January 19, 2024 05:28
@latonz latonz merged commit e606f93 into riok:main Jan 19, 2024
18 of 19 checks passed
@R-abodyak R-abodyak deleted the const_priorty_branch branch January 19, 2024 14:22
Copy link

github-actions bot commented Feb 5, 2024

🎉 This PR is included in version 3.4.0-next.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Copy link

🎉 This PR is included in version 3.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

Configurable Constructor Priority
2 participants