-
Notifications
You must be signed in to change notification settings - Fork 58
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
Remove project section check outside with_project_definition decorator #1276
Conversation
if cli_context.project_definition.native_app is None: | ||
raise NoProjectDefinitionError( | ||
project_type="native_app", project_file=cli_context.project_root | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about wrapping this in an assert_native_app_pdf
or similar?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added util function
What's the motivation behind this change? There's definitely a tradeoff happening here. |
if cli_context.project_definition.native_app is None: | ||
raise NoProjectDefinitionError( | ||
project_type="native_app", project_file=cli_context.project_root | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about introducing a helper
assert_project_type(project_type="native_app")
this would reduce the code duplication. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
Introduction of env support made all commands using project file to require full project definition. To do so we already changed |
1c3b147
to
2c36e62
Compare
2c36e62
to
53a9cce
Compare
#1276) * Remove project section check outside with_project_definition decorator * Add util function for checking project type
Pre-review checklist
Changes description
Refactor with_project_definition so that section checks are done outside of the decorator code.
Release notes not updated because there are no significant changes from the point of view of users.
This refactor was requested by @sfc-gh-turbaszek earlier. We might be introducing more code duplication with this refactor, so I would like to confirm with @sfc-gh-turbaszek if this is still needed.