smithy-lang / smithy-python

Smithy code generators and core modules for Python (in development)
Apache License 2.0
48 stars 10 forks source link

Migrate settings to immutable record #210

Closed JordonPhillips closed 7 months ago

JordonPhillips commented 7 months ago

This migrates the settings object to be an immutable record (same thing as a python dataclass), reducing any risk from passing it around.

This also removes the protocol setting. It was never actually possible to set since the fromNode method didn't check for it. But also, it's just as easy to strip out the protocols you don't want via projection transforms.

Resolving the protocol was dramatically simplified and bundled in to the protocol generator resolver.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

codecov-commenter commented 7 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 85.09%. Comparing base (b7106f4) to head (429abe6).

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #210 +/- ## ======================================== Coverage 85.09% 85.09% ======================================== Files 37 37 Lines 1134 1134 ======================================== Hits 965 965 Misses 169 169 ``` | [Flag](https://app.codecov.io/gh/smithy-lang/smithy-python/pull/210/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/smithy-lang/smithy-python/pull/210/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | `85.09% <ø> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.