Improve lint error wording

This commit is contained in:
Gustas
2023-04-29 13:46:30 +03:00
committed by Matthias Mailänder
parent 1ac6912c2a
commit 9b71317280
4 changed files with 9 additions and 9 deletions

View File

@@ -42,10 +42,10 @@ namespace OpenRA.Mods.Common.Lint
continue;
if (HasInvalidBounds(interactable.Bounds, grid.TileSize, grid.TileScale))
emitError($"{nameof(interactable.Bounds)} of actor `{actorInfo.Key}` are empty or negative.");
emitError($"{actorInfo.Key}.{interactable.GetType().Name}.{nameof(interactable.Bounds)} are empty or negative.");
if (HasInvalidBounds(interactable.DecorationBounds, grid.TileSize, grid.TileScale))
emitError($"{nameof(interactable.DecorationBounds)} of actor `{actorInfo.Key}` are empty or negative.");
emitError($"{actorInfo.Key}.{interactable.GetType().Name}.{nameof(interactable.DecorationBounds)} are empty or negative.");
}
catch (InvalidOperationException e)
{

View File

@@ -36,7 +36,7 @@ namespace OpenRA.Mods.Common.Lint
foreach (var li in locomotorInfos)
foreach (var otherLocomotor in locomotorInfos)
if (li != otherLocomotor && li.Name == otherLocomotor.Name)
emitError($"There is more than one Locomotor with name `{li.Name}`.");
emitError($"More than one Locomotor exists with the name `{li.Name}`.");
foreach (var actorInfo in rules.Actors)
{

View File

@@ -50,11 +50,11 @@ namespace OpenRA.Mods.Common.Lint
{
foreach (var ally in player.Allies)
if (!playerNames.Contains(ally))
emitError($"Allies contains player `{ally}` that is not in list.");
emitError($"The player `{player.Name}` allies list contains an invalid player `{ally}`.");
foreach (var enemy in player.Enemies)
if (!playerNames.Contains(enemy))
emitError($"Enemies contains player `{enemy}` that is not in list.");
emitError($"The player `{player.Name}` enemy list contains an invalid player `{enemy}`.");
if (player.Playable)
playablePlayerFound = true;

View File

@@ -76,7 +76,7 @@ namespace OpenRA.Mods.Common.Lint
if (modTranslation.HasMessage(key))
{
if (mapTranslation.HasMessage(key))
emitError($"Map level `{language}` translation key `{key}` will not be used.");
emitError($"Map translation key `{key}` already exists in `{language}` mod translations and will not be used.");
}
else if (!mapTranslation.HasMessage(key))
emitError($"`{key}` is not present in `{language}` translation.");
@@ -93,14 +93,14 @@ namespace OpenRA.Mods.Common.Lint
TestTraits(modData.DefaultRules, emitError, key =>
{
if (!translation.HasMessage(key))
emitError($"`{key}` not present in `{language}` translation.");
emitError($"`{key}` is not present in `{language}` translation.");
});
var gameSpeeds = modData.Manifest.Get<GameSpeeds>();
foreach (var speed in gameSpeeds.Speeds.Values)
{
if (!translation.HasMessage(speed.Name))
emitError($"`{speed.Name}` not present in `{language}` translation.");
emitError($"`{speed.Name}` is not present in `{language}` translation.");
referencedKeys.Add(speed.Name);
}
@@ -123,7 +123,7 @@ namespace OpenRA.Mods.Common.Lint
continue;
if (!translation.HasMessage(key))
emitError($"`{key}` not present in `{language}` translation.");
emitError($"`{key}` is not present in `{language}` translation.");
var translationReference = Utility.GetCustomAttributes<TranslationReferenceAttribute>(fieldInfo, true)[0];
if (translationReference.RequiredVariableNames != null && translationReference.RequiredVariableNames.Length > 0)