<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def violations(self):
 """ Returns either the diff violations or all violations depending on configuration. """

        return self._all_violations if self.config.fail_on == FAIL_ON_ANY else self._diff_violations