-
Notifications
You must be signed in to change notification settings - Fork 26
Feature/add subgroups #50
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
Feature/add subgroups #50
Conversation
@Sanlovty Let's not add a dependency to |
Sure, i'll make it <3 |
@BirjuVachhani, can u assign me to pr? |
@Sanlovty When I said class SubgroupProperty {
final String prefix;
final Map<String, String> files;
} Its fine if you don't have time for now to do this or if you don't want to. I can always take a look later. |
Oh, my bad. I'll fix it. I have time and i want to do it. |
- add optional types - add optional paths - add optional prefix - make subgroups optional - refactor fromJson method The properties (types,prefix) of the group are now overriding the sub_groups' properties. If a group has a path\paths property, it simply does not use a sub_groups at all due to their futility
@Sanlovty Thank you! Appreciate that! 😊 |
@BirjuVachhani, I think it’s working as you want now. I want to add effective tests to touch each case, but I also need to rewrite some of the existing ones. I’m waiting for your feedback. Example of using: generate_tests: true
no_comments: true
export: true
use_part_of: true
use_references_list: false
package: resources
groups:
- class_name: Images
path: assets/images
types: [ .png, .jpg, .jpeg, .webp, .webm, .bmp ]
- class_name: Svgs
sub_groups:
- path: assets/svgsMenu
prefix: menu
types: [ .svg ]
- path: assets/svgsOther
prefix: other
types: [ .svg ]
- class_name: Ico
types: [ .ico ]
prefix: ico
sub_groups:
- path: assets/icons
prefix: test1
types: [ .ttf ]
- path: assets/vectors
prefix: test2
types: [ .pdf ]
- class_name: Video
types: [ .mp4 ]
path: assets/moviesOnly
sub_groups:
- path: assets/movies
prefix: common
- path: assets/moviesExtra
prefix: extra
|
- class_name: Svgs | ||
sub_groups: | ||
- path: assets/svgsMenu | ||
prefix: menu | ||
types: [ .svg ] | ||
- path: assets/svgsOther | ||
prefix: other | ||
types: [ .svg ] | ||
- class_name: Ico | ||
types: [ .ico ] | ||
prefix: ico | ||
sub_groups: | ||
- path: assets/icons | ||
prefix: test1 | ||
types: [ .ttf ] | ||
- path: assets/vectors | ||
prefix: test2 | ||
types: [ .pdf ] | ||
- class_name: Video | ||
types: [ .mp4 ] | ||
path: assets/moviesOnly | ||
sub_groups: | ||
- path: assets/movies | ||
prefix: common | ||
- path: assets/moviesExtra | ||
prefix: extra |
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.
Lets not change default configs. Users mostly don't do this! We'll document this at https://birjuvachhani.github.io/spider
- class_name: Svgs | |
sub_groups: | |
- path: assets/svgsMenu | |
prefix: menu | |
types: [ .svg ] | |
- path: assets/svgsOther | |
prefix: other | |
types: [ .svg ] | |
- class_name: Ico | |
types: [ .ico ] | |
prefix: ico | |
sub_groups: | |
- path: assets/icons | |
prefix: test1 | |
types: [ .ttf ] | |
- path: assets/vectors | |
prefix: test2 | |
types: [ .pdf ] | |
- class_name: Video | |
types: [ .mp4 ] | |
path: assets/moviesOnly | |
sub_groups: | |
- path: assets/movies | |
prefix: common | |
- path: assets/moviesExtra | |
prefix: extra |
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.
This config is used in createConfigs method. I need to change it to run the tests
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.
If you only require this in tests then maybe we can change some things there to have it for tests only. I'd still prefer to not have all this when you actually run spider create
command.
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.
Okay, i'll rework the createConfig method
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.
Thank you!
@Sanlovty Over all look good. Nice work! 👍🏻 Just some minor changes and tests, other than that, it should be good to merge. |
@BirjuVachhani if u agree with commits after cd55a39, than i start making the tests. Also, pls check email ^-^
|
@Sanlovty Those commits look good. I like names you have given to var/getters.
Agreed. I am fine either way. |
Codecov Report
@@ Coverage Diff @@
## main #50 +/- ##
==========================================
+ Coverage 68.30% 70.56% +2.26%
==========================================
Files 13 15 +2
Lines 489 564 +75
==========================================
+ Hits 334 398 +64
- Misses 155 166 +11
Continue to review full report at Codecov.
|
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.
LGTM
Thank you @Sanlovty for your contributions. 😊 |
Released in v3.2.0 |
Description of the Change
Add a subgroup system to allow the user to create one class that includes different asset groups with unique file prefixes, paths, and extensions.
Benefits
Now you can create more flexible aseet-classes by providing different paths, file extensions and prefixes into the same class:
Config:
Result:
Possible Drawbacks
Verification Process
What process did you follow to verify that your change has the desired effects?
Applicable Issues
#49