organize
organize copied to clipboard
Define a repo for rules
Dont reinvent the wheel...
...and let users contribute their rules to a separate repo / website.
Solution
- Define some rules (naming, file endings, utf-8, etc. pp)
- Gather some volunteers to check for malitious code.
- Create a website with search ,filters and ratings
- Profit ;D
Possible match in your Roadmap https://github.com/tfeldmann/organize/projects/4#card-25088440
Good idea. Creating a website for this is a bit too much but a folder with some predefined rules would certainly be useful and could live in this repository. Goes on the todo list.
I'm having a hard time defining what these predefined rules might look like. Maybe something like snippets?
description: "Filters images containing GPS information"
type: "filter"
---
- exif: gps.gpsdate
description: "Recursively delete all empty directories"
type: "rule"
---
rules:
- locations: "__placeholder__"
targets: dirs
subfolders: true
filters:
- empty
actions:
- delete
Any good ideas?
I haven't fully thought this through, but one idea might be to allow these standalone rules to be 'include'd into the main config, and you pass any required variables to it (copying this idea from ansible)
So your generic 'blueprint' might be defined as..
description: "Recursively delete all empty directories"
type: "blueprint"
---
rules:
- locations: "{{ vars.dir }}"
targets: dirs
subfolders: true
filters:
- empty
actions:
- delete
and then you include the blueprint from your main config like...
description: "Recursively delete all empty directories"
type: "rule"
include:
file: blueprints/recursively_delete.yml
vars:
- dir: ~/Desktop/some_dir
It could then generate an error if vars.dir was not defined
It's possible this is overkill though. Perhaps a dir of example rules might be enough, and then users can simply edit them and paste them into main config.
I like the idea of generic rules you can plug in, but I wonder how often they would be used in practice