I believe the latest thinking on stretching is that static stretching, if done, should not be before you ride. OTOH dynamic stretching is recommended, though ideally after some warm up.. ie. ride around for 20 mins before doing.
A good rundown of a routine:
10 Best Stretches to Do Before Biking | LIVESTRONG.COM