I've moved my teams away from "discipline" as a solution. How many times has someone said "I'll stop doing this" or "it won't happen again" and then it does?
Discipline might work for one person (usually the one making the rules), but I've found that it's impossible to get a team to be uniformly disciplined. Even if you can do it, it's extremely time/labor-intensive.
There are many tools demonstrating that discipline doesn't work, such as Chrome add-ons that block Facebook. Even when someone understands they need to be disciplined and want to be, sometimes they just can't.
Some examples of replacing discipline with hard boundaries:
- using only languages with static typing
- rejecting commits with messages less than 3 words long
- rejecting commits without tagged issue(s)
- formatters (similar to gofmt) instead of a style guide