support two types of extra config #1
Comments
Or maybe simply dev-files:
- "/dev-for-clear/*"
- "!dev-for-clear/subdir/miss.md"
dev-files-bin:
- "/bin" |
@mlocati, for the second case I don't imagine how composer remove only |
It's just to have a simpler process: instead of having many categories, we could have just two ("remove always", and "always remove + remove bin"): docs, tests, ... could be always removed, bin only if requested. |
How about this API: package 1: {
"extra": {
"dev-files": [
"/Tests", "/docs"
],
}
} package 2: {
"extra": {
"dev-files": {
"docs": ["/docs/Some.md"],
"bin": ["/bin", "/actions/test.sh"]
},
}
} project: {
"require": {
"package 1": "*",
"package 2": "*"
},
"config": {
"octolab/cleaner": {
"clean": { "package 1": ["docs"], "package 2": ["bin"] }
}
}
}
if I change config to this: |
What about this? {
"require": {
"package 1": "*",
"package 2": "*",
"package 3": "*"
},
"config": {
"octolab/cleaner": {
"clean": {
"*": ["docs"],
"package 2": ["bin"],
"package 3": "*"
}
}
}
} The EDIT: I updated the above sample json |
Another improvement option could be a syntax like {
"clean": {
"*": "!bin"
}
} meaning "all except bin", but things start being quite complex 😉 |
yep, #1 (comment) looks interesting. if |
#1 (comment) increase complexity and I would like to implement "excluding" outside the MVP (maybe in feature release) |
Yes, I'm totally with you. |
And in case of your "case 1." above, the files could be assumed as "other". |
OK, I will freeze API tomorrow morning and write specs on wiki. With the specs I continue my work above the plugin. All features that will not be presented on it will moved to future releases. |
#1 (comment) you mean that default category name is "other" ? |
I don't see a better alternative... |
I was just trying to think of a name for this category :) "other" is good to me |
@mlocati done https://github.com/octolab/Cleaner/wiki, can you review? |
Just two notes: CategoriesLet's assume I want to delete all the unnecessary files but the Path specificationIt would be great if path specs will be compatible with the ones used by git.
And also
|
about path specification: all works based on http://symfony.com/doc/current/components/finder.html, create another component not at the moment, but I try to do it extendable. git pattern format is really true way, it is transparent to .gitattributes, and maybe it fully supported by about categories: introduce the dictionary is not a flexible way, I freeze only one word
|
So, how would you say "delete all the categories except |
https://github.com/octolab/Cleaner/wiki was updated |
important https://github.com/octolab/Cleaner/wiki#weight-of-operators to review |
Weight of operators:Consider the case when we have 100 packages, and we want to keep the config:
octolab/cleaner:
clean:
*: *
vendor/package1: !bin as
What I mean is that the |
good point, changed for this
What do you think? |
What about
I mean, the asterisk has always the lowest priority even when specifying the categories to delete: config:
octolab/cleaner:
clean:
vendor/package1: [*, !docs] IMHO it's more natural to read it delete all, but not docs (furthermore it's much saver, if someone writes an asterisk by mistake he/she delete everything). PS: what's the |
in YAML is null after parsing |
|
I using examples on YAML because I really like this format: https://github.com/kamilsk/Common/blob/3.x/package.meta Sometimes it is very powerful: https://github.com/kamilsk/Common/blob/3.x/package.meta#L26-L29 |
wiki was updated, so, if you don't have any other suggestions I lock this conversation |
👍 |
👍 |
Yes, it's cleaner and a bit shorter than json. |
fixed |
case 1.
case 2.
The text was updated successfully, but these errors were encountered: