private void applyRules(String name) {
   if (applyingRulesFor.contains(name)) {
     return;
   }
   applyingRulesFor.add(name);
   try {
     for (Rule rule : rules) {
       rule.apply(name);
     }
   } finally {
     applyingRulesFor.remove(name);
   }
 }
 /**
  * Writes a rule for the current project.
  *
  * @param rule The rule
  */
 public void addRule(Rule rule) {
   if (!currentProjectHasRules) {
     addSubheading("Rules");
   }
   getTextOutput().println(GUtil.elvis(rule.getDescription(), ""));
   currentProjectHasRules = true;
 }