Lint more const string prototypes (#18922)

This commit is contained in:
Vordenburg
2023-08-13 20:26:59 -04:00
committed by GitHub
parent 17808a54ef
commit 7582474f1a
32 changed files with 73 additions and 19 deletions

View File

@@ -14,6 +14,7 @@ namespace Content.Server.Body.Commands
[AdminCommand(AdminFlags.Fun)]
sealed class AddHandCommand : IConsoleCommand
{
[ValidatePrototypeId<EntityPrototype>]
public const string DefaultHandPrototype = "LeftHandHuman";
public string Command => "addhand";

View File

@@ -1,9 +1,10 @@
using Content.Server.CrewManifest;
using Content.Server.CrewManifest;
using Content.Server.Station.Systems;
using Content.Shared.CartridgeLoader;
using Content.Shared.CartridgeLoader.Cartridges;
using Content.Shared.CCVar;
using Robust.Shared.Configuration;
using Robust.Shared.Prototypes;
namespace Content.Server.CartridgeLoader.Cartridges;
@@ -14,6 +15,7 @@ public sealed class CrewManifestCartridgeSystem : EntitySystem
[Dependency] private readonly CrewManifestSystem _crewManifest = default!;
[Dependency] private readonly StationSystem _stationSystem = default!;
[ValidatePrototypeId<EntityPrototype>]
private const string CartridgePrototypeName = "CrewManifestCartridge";
/// <summary>

View File

@@ -15,6 +15,7 @@ using JetBrains.Annotations;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Containers;
using Robust.Shared.Prototypes;
namespace Content.Server.Chemistry.EntitySystems
{
@@ -36,6 +37,7 @@ namespace Content.Server.Chemistry.EntitySystems
[Dependency] private readonly ISharedAdminLogManager _adminLogger = default!;
[Dependency] private readonly AppearanceSystem _appearance = default!;
[ValidatePrototypeId<EntityPrototype>]
private const string PillPrototypeId = "Pill";
public override void Initialize()

View File

@@ -16,7 +16,10 @@ namespace Content.Server.Construction.Commands
public string Description => "Puts an underplating tile below every wall on a grid.";
public string Help => $"Usage: {Command} <gridId> | {Command}";
[ValidatePrototypeId<ContentTileDefinition>]
public const string TilePrototypeId = "Plating";
[ValidatePrototypeId<TagPrototype>]
public const string WallTag = "Wall";
public void Execute(IConsoleShell shell, string argStr, string[] args)

View File

@@ -12,6 +12,7 @@ namespace Content.Server.Electrocution
public string Description => Loc.GetString("electrocute-command-description");
public string Help => $"{Command} <uid> <seconds> <damage>";
[ValidatePrototypeId<StatusEffectPrototype>]
public const string ElectrocutionStatusEffect = "Electrocution";
public void Execute(IConsoleShell shell, string argStr, string[] args)

View File

@@ -52,7 +52,10 @@ public sealed class ElectrocutionSystem : SharedElectrocutionSystem
[Dependency] private readonly SharedStutteringSystem _stuttering = default!;
[Dependency] private readonly TagSystem _tag = default!;
[ValidatePrototypeId<StatusEffectPrototype>]
private const string StatusEffectKey = "Electrocution";
[ValidatePrototypeId<DamageTypePrototype>]
private const string DamageType = "Shock";
// Yes, this is absurdly small for a reason.

View File

@@ -61,6 +61,7 @@ public sealed partial class ExplosionSystem : EntitySystem
/// find errors. However some components, like rogue arrows, or some commands like the admin-smite need to have
/// a "default" option specified outside of yaml data-fields. Hence this const string.
/// </remarks>
[ValidatePrototypeId<ExplosionPrototype>]
public const string DefaultExplosionPrototypeId = "Default";
public override void Initialize()

View File

@@ -1,5 +1,6 @@
using Content.Server.Fluids.Components;
using Content.Shared.Chemistry.Components;
using Content.Shared.Chemistry.Reagent;
using Content.Shared.FixedPoint;
using Content.Shared.Fluids.Components;
@@ -9,6 +10,7 @@ public sealed partial class PuddleSystem
{
private static readonly TimeSpan EvaporationCooldown = TimeSpan.FromSeconds(1);
[ValidatePrototypeId<ReagentPrototype>]
public const string EvaporationReagent = "Water";
private void OnEvaporationMapInit(EntityUid uid, EvaporationComponent component, MapInitEvent args)

View File

@@ -6,6 +6,7 @@ namespace Content.Server.GameTicking
{
public sealed partial class GameTicker
{
[ValidatePrototypeId<SoundCollectionPrototype>]
private const string LobbyMusicCollection = "LobbyMusic";
[ViewVariables]

View File

@@ -9,13 +9,13 @@ using Content.Server.Speech.Components;
using Content.Server.Station.Components;
using Content.Shared.CCVar;
using Content.Shared.Database;
using Content.Shared.GameTicking;
using Content.Shared.Preferences;
using Content.Shared.Roles;
using JetBrains.Annotations;
using Robust.Server.Player;
using Robust.Shared.Map;
using Robust.Shared.Network;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
using Robust.Shared.Utility;
using Job = Content.Server.Roles.Job;
@@ -26,6 +26,7 @@ namespace Content.Server.GameTicking
{
[Dependency] private readonly IAdminManager _adminManager = default!;
[ValidatePrototypeId<EntityPrototype>]
private const string ObserverPrototypeName = "MobObserver";
/// <summary>

View File

@@ -1,17 +1,15 @@
using System.Threading;
using Content.Server.Shuttles.Components;
using Content.Server.Shuttles.Events;
using Content.Server.Station.Components;
using Content.Server.UserInterface;
using Content.Shared.Access;
using Content.Shared.CCVar;
using Content.Shared.Database;
using Content.Shared.GameTicking;
using Content.Shared.Popups;
using Content.Shared.Shuttles.BUIStates;
using Content.Shared.Shuttles.Events;
using Content.Shared.Shuttles.Systems;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Map;
using Robust.Shared.Player;
using Timer = Robust.Shared.Timing.Timer;
@@ -63,6 +61,7 @@ public sealed partial class EmergencyShuttleSystem
private CancellationTokenSource? _roundEndCancelToken;
[ValidatePrototypeId<AccessLevelPrototype>]
private const string EmergencyRepealAllAccess = "EmergencyShuttleRepealAll";
private static readonly Color DangerColor = Color.Red;

View File

@@ -16,6 +16,7 @@ using Content.Shared.CCVar;
using Content.Shared.Database;
using Content.Shared.Shuttles.Components;
using Content.Shared.Shuttles.Events;
using Content.Shared.Tag;
using Content.Shared.Tiles;
using Robust.Server.GameObjects;
using Robust.Server.Maps;
@@ -60,6 +61,7 @@ public sealed partial class EmergencyShuttleSystem : EntitySystem
private bool _emergencyShuttleEnabled;
[ValidatePrototypeId<TagPrototype>]
private const string DockTag = "DockEmergency";
public override void Initialize()

View File

@@ -1,4 +1,4 @@
using System.Text;
using System.Text;
using System.Text.RegularExpressions;
using Content.Shared.Speech.Components;
using Content.Shared.Speech.EntitySystems;
@@ -9,6 +9,9 @@ namespace Content.Server.Speech.EntitySystems;
public sealed class RatvarianLanguageSystem : SharedRatvarianLanguageSystem
{
[Dependency] private readonly StatusEffectsSystem _statusEffects = default!;
[ValidatePrototypeId<StatusEffectPrototype>]
private const string RatvarianKey = "RatvarianLanguage";
// This is the word of Ratvar and those who speak it shall abide by His rules:

View File

@@ -12,6 +12,7 @@ public sealed class SlurredSystem : SharedSlurredSystem
[Dependency] private readonly StatusEffectsSystem _statusEffectsSystem = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[ValidatePrototypeId<StatusEffectPrototype>]
private const string SlurKey = "SlurredSpeech";
public override void Initialize()

View File

@@ -12,8 +12,6 @@ namespace Content.Server.Speech.EntitySystems
[Dependency] private readonly StatusEffectsSystem _statusEffectsSystem = default!;
[Dependency] private readonly IRobustRandom _random = default!;
private const string StutterKey = "Stutter";
// Regex of characters to stutter.
private static readonly Regex Stutter = new(@"[b-df-hj-np-tv-wxyz]",
RegexOptions.Compiled | RegexOptions.IgnoreCase);

View File

@@ -12,6 +12,7 @@ public sealed class KudzuSystem : EntitySystem
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
[Dependency] private readonly DamageableSystem _damageable = default!;
[ValidatePrototypeId<EdgeSpreaderPrototype>]
private const string KudzuGroup = "kudzu";
/// <inheritdoc/>

View File

@@ -31,6 +31,7 @@ public sealed class SpreaderSystem : EntitySystem
private readonly List<string> _spreaderGroups = new();
[ValidatePrototypeId<TagPrototype>]
private const string IgnoredTag = "SpreaderIgnore";
/// <inheritdoc/>

View File

@@ -4,6 +4,7 @@ using Content.Shared.Inventory;
using Content.Shared.PDA;
using Content.Server.Store.Components;
using Content.Shared.FixedPoint;
using Content.Shared.Store;
namespace Content.Server.Traitor.Uplink
{
@@ -13,6 +14,7 @@ namespace Content.Server.Traitor.Uplink
[Dependency] private readonly SharedHandsSystem _handsSystem = default!;
[Dependency] private readonly StoreSystem _store = default!;
[ValidatePrototypeId<CurrencyPrototype>]
public const string TelecrystalCurrencyPrototype = "Telecrystal";
/// <summary>

View File

@@ -9,6 +9,7 @@ namespace Content.Server.Traits.Assorted;
/// </summary>
public sealed class NarcolepsySystem : EntitySystem
{
[ValidatePrototypeId<StatusEffectPrototype>]
private const string StatusEffectKey = "ForcedSleep"; // Same one used by N2O and other sleep chems.
[Dependency] private readonly StatusEffectsSystem _statusEffects = default!;