Skip to content

Commit

Permalink
Remove unused usings from example and exemplar (#2387)
Browse files Browse the repository at this point in the history
* Add Xunit using include

* Enable implicit usings

* Remove unused usings

* Remove unused usings from example and exemplar

[no important files changed]

* Less cleanup of test project

* Use locked-mode to restore packages (#2388)

* Add lock file

* Use locked-mode to restore packages

[no important files changed]

* Enable nullable (#2392)

* Enable nullable

* Several nullable fixes

* Fix dot-dsl

* calculator-conundrum: fix nullable

* developer-privileges: fix nullable

* face-id2: fix

* zebra-puzzle: fix

* pov: fix

* zipper: fix

* tournament: fix

* simple-linked-list: fix

* sgf-parsing: fix

* rest-api: fix

* react: fix

* robot-name: fix

* say: fix

* satellite: fix

* change: fix

* custom-set: fix

* grep: fix

* binary-search-tree: fix

* linked-list: fix

* alphametics: fix

* hangman: fix

* wizards-and-warriors-2: fix

* remote-control-cleanup: fix

* land-grab-in-space: fix

* instruments-of-texas: fix

* markdown: fix

* Dont remove nullable in new exercise

* More fixes

* remote-control: fix

[no important files changed]

* Fix warnings (#2391)

[no important files changed]

* Enable nullable (#2392)

* Enable nullable

* Several nullable fixes

* Fix dot-dsl

* calculator-conundrum: fix nullable

* developer-privileges: fix nullable

* face-id2: fix

* zebra-puzzle: fix

* pov: fix

* zipper: fix

* tournament: fix

* simple-linked-list: fix

* sgf-parsing: fix

* rest-api: fix

* react: fix

* robot-name: fix

* say: fix

* satellite: fix

* change: fix

* custom-set: fix

* grep: fix

* binary-search-tree: fix

* linked-list: fix

* alphametics: fix

* hangman: fix

* wizards-and-warriors-2: fix

* remote-control-cleanup: fix

* land-grab-in-space: fix

* instruments-of-texas: fix

* markdown: fix

* Dont remove nullable in new exercise

* More fixes

* remote-control: fix

[no important files changed]

* Fix

* More

* Tiny fix

* And more

* Another

* And more

[no important files changed]
  • Loading branch information
ErikSchierboom authored Feb 18, 2025
1 parent be3ec0d commit 1a54dba
Show file tree
Hide file tree
Showing 672 changed files with 914 additions and 1,230 deletions.
6 changes: 0 additions & 6 deletions bin/add-practice-exercise.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,6 @@ $project = "${exerciseDir}/${ExerciseName}.csproj"
& dotnet new xunit --force -lang "C#" --target-framework-override net9.0 -o $exerciseDir -n $ExerciseName
& dotnet sln exercises/Exercises.sln add $project

# Cleanup project file
[xml]$projectXml = Get-Content "${project}"
$projectXml.Project.RemoveChild($projectXml.Project.ItemGroup[1])
$projectXml.Project.PropertyGroup.RemoveChild($projectXml.Project.PropertyGroup.SelectSingleNode("ImplicitUsings"))
$projectXml.Save("${project}")

# Update project packages
& dotnet remove $project package coverlet.collector
& dotnet add $project package Exercism.Tests --version 0.1.0-beta1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System;

static class QuestLogic
{
public static bool CanFastAttack(bool knightIsAwake)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
</PropertyGroup>

<ItemGroup>
<Using Include="Xunit" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="xunit" Version="2.8.1" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using Xunit;
using Exercism.Tests;

public class AnnalynsInfiltrationTests
Expand Down
2 changes: 0 additions & 2 deletions exercises/concept/attack-of-the-trolls/.meta/Exemplar.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System;

enum AccountType
{
Guest,
Expand Down
2 changes: 0 additions & 2 deletions exercises/concept/attack-of-the-trolls/AttackOfTheTrolls.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System;

// TODO: define the 'AccountType' enum

// TODO: define the 'Permission' enum
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
</PropertyGroup>

<ItemGroup>
<Using Include="Xunit" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="xunit" Version="2.8.1" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using Xunit;
using Exercism.Tests;

public class AttackOfTheTrollsTests
Expand Down
1 change: 0 additions & 1 deletion exercises/concept/authentication-system/.meta/Exemplar.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;

public class Authenticator
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System.Collections.Generic;

public class Authenticator
{
private class EyeColor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
</PropertyGroup>

<ItemGroup>
<Using Include="Xunit" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="xunit" Version="2.8.1" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using System;
using System.Collections.Generic;
using Xunit;
using Exercism.Tests;

public class AuthenticationSystemTests
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System;
using System.Globalization;
using System.Runtime.InteropServices;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using System;


public enum Location
{
NewYork,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
</PropertyGroup>

<ItemGroup>
<Using Include="Xunit" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="xunit" Version="2.8.1" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Threading;
using Xunit;

using Exercism.Tests;

public class BeautySalonGoesGlobalTests
Expand Down
2 changes: 0 additions & 2 deletions exercises/concept/bird-watcher/.meta/Exemplar.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System;

class BirdCount
{
private int[] birdsPerDay;
Expand Down
2 changes: 0 additions & 2 deletions exercises/concept/bird-watcher/BirdWatcher.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System;

class BirdCount
{
private int[] birdsPerDay;
Expand Down
5 changes: 5 additions & 0 deletions exercises/concept/bird-watcher/BirdWatcher.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
</PropertyGroup>

<ItemGroup>
<Using Include="Xunit" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="xunit" Version="2.8.1" />
Expand Down
1 change: 0 additions & 1 deletion exercises/concept/bird-watcher/BirdWatcherTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using Xunit;
using Exercism.Tests;

public class BirdWatcherTests
Expand Down
2 changes: 0 additions & 2 deletions exercises/concept/booking-up-for-beauty/.meta/Exemplar.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System;

static class Appointment
{
public static DateTime Schedule(string appointmentDateDescription)
Expand Down
2 changes: 0 additions & 2 deletions exercises/concept/booking-up-for-beauty/BookingUpForBeauty.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System;

static class Appointment
{
public static DateTime Schedule(string appointmentDateDescription)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
</PropertyGroup>

<ItemGroup>
<Using Include="Xunit" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="xunit" Version="2.8.1" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using Xunit;
using Exercism.Tests;
using System;

using System.Globalization;
using System.Threading;

public class BookingUpForBeautyTests
{
Expand Down
3 changes: 0 additions & 3 deletions exercises/concept/building-telemetry/.meta/Exemplar.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using System;


public class RemoteControlCar
{
private int batteryPercentage = 100;
Expand Down
2 changes: 0 additions & 2 deletions exercises/concept/building-telemetry/BuildingTelemetry.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System;

public class RemoteControlCar
{
private int batteryPercentage = 100;
Expand Down
5 changes: 5 additions & 0 deletions exercises/concept/building-telemetry/BuildingTelemetry.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
</PropertyGroup>

<ItemGroup>
<Using Include="Xunit" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="xunit" Version="2.8.1" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using Xunit;
using Exercism.Tests;

public class BuildingTelemetryTests
Expand Down
2 changes: 0 additions & 2 deletions exercises/concept/calculator-conundrum/.meta/Exemplar.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System;

public static class SimpleCalculator
{
public static string Calculate(int operand1, int operand2, string? operation)
Expand Down
2 changes: 0 additions & 2 deletions exercises/concept/calculator-conundrum/CalculatorConundrum.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System;

public static class SimpleCalculator
{
public static string Calculate(int operand1, int operand2, string? operation)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
</PropertyGroup>

<ItemGroup>
<Using Include="Xunit" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="xunit" Version="2.8.1" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using Xunit;
using Exercism.Tests;
using System;

public class CalculatorConundrumTests
{
Expand Down
2 changes: 0 additions & 2 deletions exercises/concept/cars-assemble/CarsAssemble.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System;

static class AssemblyLine
{
public static double SuccessRate(int speed)
Expand Down
5 changes: 5 additions & 0 deletions exercises/concept/cars-assemble/CarsAssemble.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
</PropertyGroup>

<ItemGroup>
<Using Include="Xunit" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="xunit" Version="2.8.1" />
Expand Down
1 change: 0 additions & 1 deletion exercises/concept/cars-assemble/CarsAssembleTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using Xunit;
using Exercism.Tests;

public class CarsAssembleTests
Expand Down
3 changes: 0 additions & 3 deletions exercises/concept/developer-privileges/.meta/Exemplar.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using System;
using System.Collections.Generic;

public class Authenticator
{
public Identity Admin { get; } = new Identity
Expand Down
3 changes: 0 additions & 3 deletions exercises/concept/developer-privileges/DeveloperPrivileges.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using System;
using System.Collections.Generic;

public class Authenticator
{
// TODO: Implement the Authenticator.Admin property
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
</PropertyGroup>

<ItemGroup>
<Using Include="Xunit" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="xunit" Version="2.8.1" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using Xunit;
using Exercism.Tests;

public class DeveloperPrivilegesTests
Expand Down
2 changes: 0 additions & 2 deletions exercises/concept/elons-toys/ElonsToys.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System;

class RemoteControlCar
{
public static RemoteControlCar Buy()
Expand Down
5 changes: 5 additions & 0 deletions exercises/concept/elons-toys/ElonsToys.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
</PropertyGroup>

<ItemGroup>
<Using Include="Xunit" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="xunit" Version="2.8.1" />
Expand Down
1 change: 0 additions & 1 deletion exercises/concept/elons-toys/ElonsToysTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using Xunit;
using Exercism.Tests;

public class ElonsToysTests
Expand Down
3 changes: 0 additions & 3 deletions exercises/concept/faceid-2/.meta/Exemplar.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using System;
using System.Collections.Generic;

public class FacialFeatures
{
public string EyeColor { get; }
Expand Down
2 changes: 0 additions & 2 deletions exercises/concept/faceid-2/Faceid2.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System;

public class FacialFeatures
{
public string EyeColor { get; }
Expand Down
5 changes: 5 additions & 0 deletions exercises/concept/faceid-2/Faceid2.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
</PropertyGroup>

<ItemGroup>
<Using Include="Xunit" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="xunit" Version="2.8.1" />
Expand Down
1 change: 0 additions & 1 deletion exercises/concept/faceid-2/Faceid2Tests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using Xunit;
using Exercism.Tests;

public class Faceid2Tests
Expand Down
Loading

0 comments on commit 1a54dba

Please sign in to comment.