IMO there's no "right" length. Instead focus on getting the housing to meet the end fitting squarely. There's rarely an issue with how it meets the chainstay fitting unless it's way too long, so go by the RD fitting. If too short, the housing will pull toward the front of the bike creating an angle there. If too long it will push toward the back. But when just right the housing will meet the fitting straight, making for a smooth line for the inner wire.
__________________
FB
Chain-L site
An ounce of diagnosis is worth a pound of cure.
Just because I'm tired of arguing, doesn't mean you're right.
“One accurate measurement is worth a thousand expert opinions” - Adm Grace Murray Hopper - USN
WARNING, I'm from New York. Thin skinned people should maintain safe distance.