You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I hope you'll reconsider using regexps for matching identifiers on the command line. It makes it too easy for admins to shoot themselves in the foot. To prove my point, the docs at http://melor.github.com/poni/template-variables.html use an unanchored $find("webshop/frontend"), which would match e.g. webshop/frontendforsomethingelse.
I'd be much happier if Poni used globs, because they have way fewer magic characters, and those tend to stick out more. I've seen people hurt themselves even with the periods in DNS domain names, when used directly as a regexp pattern. You could always provide a --regex option for when the power is needed.
The text was updated successfully, but these errors were encountered:
There are a two separate variables here: full string matching vs. partial string matching and the pattern matching syntax used (regex vs. glob).
I believe you are right with your concerns and I have actually been already thinking about changing the default to be strict full path matching for most commands and template functions. Using globs did not occur to me as I was only aware of the "glob" module, which does not provide generic pattern matching functionality, just globbing file paths. Now that I dug a bit deeper and found "fnmatch", I see that using it would be rather trivial for this purpose.
However, there are already multiple souls whose wrath will unleash over me if I change the default behavior, so making this change happen will need some careful coordination.
Issue in consideration, no ETA yet.
quosa
pushed a commit
to quosa/poni
that referenced
this issue
Feb 20, 2014
I hope you'll reconsider using regexps for matching identifiers on the command line. It makes it too easy for admins to shoot themselves in the foot. To prove my point, the docs at http://melor.github.com/poni/template-variables.html use an unanchored $find("webshop/frontend"), which would match e.g. webshop/frontendforsomethingelse.
I'd be much happier if Poni used globs, because they have way fewer magic characters, and those tend to stick out more. I've seen people hurt themselves even with the periods in DNS domain names, when used directly as a regexp pattern. You could always provide a --regex option for when the power is needed.
The text was updated successfully, but these errors were encountered: