code: private void addRuleFiles(List<RuleSource> sources, File directory) throws MojoExecutionException {
          List<RuleSource> ruleSources = readRulesDirectory(directory);
          for (RuleSource ruleSource : ruleSources) {
              getLog().debug("Adding rules from file " + ruleSource);
              sources.add(ruleSource);
          }
      }
docs: Add rules from the given directory to the list of sources.
  
  @param sources   The sources.
  @param directory The directory.
  @throws MojoExecutionException On error.