-
Notifications
You must be signed in to change notification settings - Fork 29
refactor: base PR for removal of kwargs from generators module #1785
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
base: develop
Are you sure you want to change the base?
Conversation
if item.file_name == "app.conf": | ||
# pass kwargs only for AppConf generator | ||
file_details = item.file_class( | ||
global_config, input_dir, output_dir, **kwargs |
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.
I think **kwargs
can be deleted as the init does not expects it.
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.
Made the changes.
**kwargs: Any | ||
): | ||
self.description = kwargs["app_manifest"].get_description() | ||
self.title = kwargs["app_manifest"].get_title() | ||
self.author = kwargs["app_manifest"].get_authors()[0]["name"] |
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.
Can we also remove kwargs here and provide app_manifest directly? From what I see, the only initialization is in the commands/build
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.
Made the changes, moved _get_app_manifest
function in utils.py
self.title = kwargs["app_manifest"].get_title() | ||
self.author = kwargs["app_manifest"].get_authors()[0]["name"] | ||
self.addon_version = self._global_config.version | ||
self.is_visible = str(self._global_config.has_pages()).lower() |
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.
previously we had global_config.meta.get("isVisible", True)
, can we replace it with just .has_pages()
?
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 the code.
def test_set_attributes_check_for_updates_false( | ||
mock_app_manifest, |
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.
nit: I would change it's name to avoid naming conflicts. Same for the rest below
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.
Renamed the fixture.
Code Coverage 🎉
|
Issue number: ADDON-81314
PR Type
What kind of change does this PR introduce?
Summary
Changes
This PR contains base changes for removal of
kwargs
from generators module.kwargs
from conf file generation -> refactor: remove kwargs from conf generation files #1787kwargs
from XML, HTML and Python file generation -> refactor: remove kwargs from html,python and xml files of generator module #1786PS: It also contains unit test changes for all files of generators module to make the pipeline green.
User experience
No change in User experience.
Checklist
If an item doesn't apply to your changes, leave it unchecked.
Review
Tests
See the testing doc.
Demo/meeting:
Reviewers are encouraged to request meetings or demos if any part of the change is unclear