I have seen passengers turned away on formal nights for jeans in the main dining room on Princess ships. The dress code for the evening does include the specialty restaurants. The only places the dress code is not observed, to my knowledge, on the Princess ships I've been on were the casino and the buffet. On formal nights, the casino goes to non-smoking, too. So far, I've not seen them allow shorts in the main dining rooms on non-formal evenings, either.
On the 10 cruises I've been with Princess, I can say that 99% of the passengers do adhere to the dress code for the evening.