Humanizr/Humanizer · error · InvalidOperationException

Generated Unicode 16 inflection data is stale. Run the gener

Error message

Generated Unicode 16 inflection data is stale. Run the generator without --check.

What it means

Thrown by the UnicodeDataGenerator when run with the --check flag and the checked-in generated file (InflectionUnicodeData.cs) differs from what the generator would produce. This is a staleness guard used in CI to ensure generated data is always committed after regeneration.

Source

Thrown at tools/Humanizer.UnicodeDataGenerator/Program.cs:116

    "generated-unicode-scripts",
    GenerateScriptBlock(
        Path.Combine(inputDirectory, "Scripts.txt"),
        Path.Combine(inputDirectory, "ScriptExtensions.txt"),
        inputs["Scripts.txt"],
        inputs["ScriptExtensions.txt"]));
unicodeSource = ReplaceGeneratedBlock(
    unicodeSource,
    "generated-unicode-nfc-quick-check",
    GenerateNfcQuickCheckBlock(
        Path.Combine(inputDirectory, "DerivedNormalizationProps.txt"),
        inputs["DerivedNormalizationProps.txt"]));

var unicodeChanged = CheckOrWrite(unicodeDataFile, unicodeSource, check);
if (check)
{
    if (unicodeChanged)
    {
        throw new InvalidOperationException(
            "Generated Unicode 16 inflection data is stale. Run the generator without --check.");
    }

    Console.WriteLine("Unicode 16 inflection data is current and all five source hashes match.");
}
else
{
    Console.WriteLine("Regenerated Unicode 16 inflection data from all five hash-pinned inputs.");
}

return 0;

static string FindRepositoryRoot(string start)
{
    for (var current = new DirectoryInfo(start); current is not null; current = current.Parent)
    {
        if (File.Exists(Path.Combine(current.FullName, "Humanizer.slnx")))
        {

View on GitHub (pinned to ffc2b77c0f)

Solutions

  1. Run the generator WITHOUT the --check flag to regenerate the output, then commit the result.
  2. Ensure you run the generator from the correct directory with all UCD files present.
  3. Add a pre-commit or local build step that runs the generator automatically.

Example fix

# before: check fails because output is stale
dotnet run --project tools/Humanizer.UnicodeDataGenerator -- ./ucd --check

# after: regenerate, then commit
dotnet run --project tools/Humanizer.UnicodeDataGenerator -- ./ucd
git add src/Humanizer/Inflections/InflectionUnicodeData.cs
git commit -m "chore: regenerate Unicode 16 inflection data"
Defensive patterns

Strategy: fallback

Prevention

When it happens

Trigger: Running dotnet run --project tools/Humanizer.UnicodeDataGenerator -- <dir> --check after modifying the generator or updating UCD data without regenerating the output file. The CheckOrWrite function detects the diff.

Common situations: CI pipeline runs the check and fails because the developer forgot to regenerate. Generator logic was updated but the output wasn't re-committed. UCD input hashes were changed in a PR without running the generator.

Related errors


AI-assisted analysis of Humanizr/Humanizer@ffc2b77c0f (2026-08-13). Data as JSON: /api/errors/e7b463417d910779. Report an issue: GitHub.