Open dbr opened 4 years ago
Most flexible way would be to have a custom_patterns = {'pattern': '...', order: '...'}
or something, but that seems a bit clunky
Instead maybe just:
custom_patterns
config option, default empty, with a list of regexscustom_patterns_order
which can be either before
, after
, or replace
(i.e before builtins, after builtins, or replace them entirely). Default would probably be "before".This makes it easy to just add one or two custom patterns, and either prefer them tot eh builtins, or use them as a fallback. The "replace" option would be useful to customize the pattern matching in more complex ways (or only handle a very specific set of patterns)
I'd really like to see this. I only wanted to add a single custom pattern and now see that I'm overwriting all the default patterns.
I like your custom_patterns
idea.
Currently saving the config includes the complete list of regex patterns
This probably isn't too good, as most of the time people a) wont change them, or b) won't remove that option and this wont pick up improvements to the default patterns
Instead the default patterns should be moved out of the config, and instead:
Should use v4.0 to deprecate the
filename_patterns
option - keep respecting it for now, but emit warning that this option will be removed soon