Skip to content

Commit

Permalink
chore: add lint for null-forgiving operator
Browse files Browse the repository at this point in the history
  • Loading branch information
winstxnhdw committed Feb 13, 2024
1 parent 4d620d7 commit b27943f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
7 changes: 5 additions & 2 deletions lc-hax/Scripts/Components/CharacterMovement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ internal class CharacterMovement : MonoBehaviour {
Keyboard Keyboard { get; set; } = Keyboard.current;
KeyboardMovement? NoClipKeyboard { get; set; } = null;

internal void SetNoClipMode(bool enabled) => this.NoClipKeyboard!.enabled = enabled;
internal void SetNoClipMode(bool enabled) {
if (this.NoClipKeyboard is null) return;
this.NoClipKeyboard.enabled = enabled;
}

// Initialize method
internal void Init() {
Expand All @@ -43,7 +46,7 @@ void Awake() {

// Update is called once per frame
void Update() {
if (this.NoClipKeyboard!.enabled) return;
if (this.NoClipKeyboard?.enabled is not true) return;

// Read movement input from keyboard
Vector2 moveInput = new Vector2(
Expand Down
7 changes: 6 additions & 1 deletion lc-hax/lc-hax.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,15 @@
<NoWarn>NU1701</NoWarn>
</PackageReference>

<PackageReference Include="Quickenshtein" Version="1.5.1" />
<PackageReference Include="Nullable.Extended.Analyzer" Version="1.15.6169">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>

<PackageReference Include="RequireNamedArgs" Version="0.0.7" />

<PackageReference Include="Quickenshtein" Version="1.5.1" />

<EmbeddedResource Include="$(NuGetPath)/lib.harmony/2.2.2/lib/net48/0Harmony.dll" />

<EmbeddedResource Include="$(NuGetPath)/Quickenshtein/1.5.1/lib/netstandard2.0/Quickenshtein.dll" />
Expand Down
6 changes: 6 additions & 0 deletions lc-hax/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
"resolved": "2.2.2",
"contentHash": "70KvWz+DiUELxafsYL/LHxA/jH3PDWeApLo/VwtnrpTvRWQ/eUdPfS/l5funmhZWOy41QXw6UjVv+6C57Nx77A=="
},
"Nullable.Extended.Analyzer": {
"type": "Direct",
"requested": "[1.15.6169, )",
"resolved": "1.15.6169",
"contentHash": "ywYUOukrgjzwGIAJEW8k/Cc98Y61xvM0JFt9LHrblz2wFwl0aVk31rdYh6Y+guFJQtzIwHrM4IY++0szJjLvQg=="
},
"Quickenshtein": {
"type": "Direct",
"requested": "[1.5.1, )",
Expand Down

0 comments on commit b27943f

Please sign in to comment.