Skip to content

Conversation

@mrm9084
Copy link
Contributor

@mrm9084 mrm9084 commented Jul 31, 2024

Description

This PR starts to add static type checking to the Feature Management library.
See: mypy.ini for details on what is enabled and what isn't.

Starts work on this: #33

Note: Currently this will not be part of the build step until more is done.
Note: Due to some of the type check added to pass mypy some code changes were required.

Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.
  • Pull request includes test coverage for the included changes.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR.

@mrm9084 mrm9084 requested a review from zhiyuanliang-ms August 5, 2024 16:44


def _convert_boolean_value(enabled):
def _convert_boolean_value(enabled: Union[str, bool], feature_name: str) -> bool:
Copy link
Member

Choose a reason for hiding this comment

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

Feels weird to pass in the name here only for the error message.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is so we can match the error message as we have in the other libraries. It also feels weird to do the check outside of this.

@mrm9084 mrm9084 requested a review from rossgrambo August 5, 2024 20:14
@mrm9084 mrm9084 merged commit 789120f into main Aug 5, 2024
@mrm9084 mrm9084 deleted the TypeChecker branch August 5, 2024 21:49
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

Successfully merging this pull request may close these issues.

4 participants