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

Cosmetics + minor optimization for CleanUp plugin #1086

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

BigRoy
Copy link
Collaborator

@BigRoy BigRoy commented Jan 15, 2025

Changelog Description

  • Use PublishError instead of assertion
  • Optimize the 'check for errors'
  • Optimize the product type check + log debug message when skipped due to that
    • Do note that previously it'd also match if the exclude family was e.g. clip yet the product type of the instance was shotclip or clippy or clip.audio because it'd check if the string was IN the product type, it didn't check for exact match (which it does now)
  • Move imports to top.

Additional info

n/a

Testing notes:

  1. Cleanup should still work
  2. "Exclude families" should still work as needed

- Use `PublishError` instead of assertion
- Optimize the 'check for errors'
- Optimize the product type check + log debug message when skipped due to that
- Move imports to top
@BigRoy BigRoy added community Issues and PRs coming from the community members type: enhancement Improvement of existing functionality or minor addition labels Jan 15, 2025
@BigRoy BigRoy requested a review from iLLiCiTiT January 15, 2025 09:58
@BigRoy BigRoy self-assigned this Jan 15, 2025
@ynbot ynbot added the size/XS label Jan 15, 2025
@@ -71,10 +72,12 @@ def process(self, instance):
self.log.debug("Cleaning renders new...")
self.clean_renders(instance, skip_cleanup_filepaths)

if [ef for ef in self.exclude_families
if instance.data["productType"] in ef]:
product_type = instance.data["productType"]
Copy link
Member

Choose a reason for hiding this comment

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

Oh lord, this plugin...

This condition should probably happen before error checks. And we should change exclude_families to exclude_product_types.

I don't know why there was "str in str" check instead of "str == str"? I guess that is question for @jakubjezek001 who might be able to tell if there are product types that should be skipped too and contain "clip"?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh lord, this plugin...

Thank for sharing my feelings 🙉 🙈 🙊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community Issues and PRs coming from the community members size/XS type: enhancement Improvement of existing functionality or minor addition
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants