Skip to content

Commit

Permalink
-whitespace, +emptiness checks
Browse files Browse the repository at this point in the history
  • Loading branch information
DennisSoemers committed Jun 27, 2024
1 parent 5a34c61 commit 51a8662
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,18 @@ else if (ruleset != null && ruleset.optionSettings().isEmpty())
writer.println("EnglishRules,LudRules");

// Write the actual data
final String englishRules = StringRoutines.join(" ", game.metadata().info().getRules()).replaceAll(Pattern.quote("\n"), " ");
final String englishRules = StringRoutines.cleanWhitespace(StringRoutines.join(" ", game.metadata().info().getRules()).replaceAll(Pattern.quote("\n"), " "));
final String ludDescription = StringRoutines.cleanWhitespace(game.description().expanded().replaceAll(Pattern.quote("\n"), " "));

if (englishRules.replaceAll(Pattern.quote("\""), "").isEmpty())
{
System.err.println("Empty English rules description for: " + gameName + " - " + rulesetName);
}
if (ludDescription.replaceAll(Pattern.quote("\""), "").isEmpty())
{
System.err.println("Empty .lud description for: " + gameName + " - " + rulesetName);
}

try
{
@SuppressWarnings("unused")
Expand Down

0 comments on commit 51a8662

Please sign in to comment.