Skip to content

Commit

Permalink
Revert "Remove unused usings from example and exemplar (#2387)" (#2393)
Browse files Browse the repository at this point in the history
This reverts commit 1a54dba.

[no important files changed]
  • Loading branch information
ErikSchierboom authored Feb 18, 2025
1 parent 1a54dba commit 2afd127
Show file tree
Hide file tree
Showing 672 changed files with 1,230 additions and 914 deletions.
6 changes: 6 additions & 0 deletions bin/add-practice-exercise.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ $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,3 +1,5 @@
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,14 +3,9 @@
<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,3 +1,4 @@
using Xunit;
using Exercism.Tests;

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

enum AccountType
{
Guest,
Expand Down
2 changes: 2 additions & 0 deletions exercises/concept/attack-of-the-trolls/AttackOfTheTrolls.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
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,14 +3,9 @@
<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,3 +1,4 @@
using Xunit;
using Exercism.Tests;

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

public class Authenticator
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
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,14 +3,9 @@
<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,3 +1,6 @@
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,3 +1,4 @@
using System;
using System.Globalization;
using System.Runtime.InteropServices;

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


public enum Location
{
NewYork,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,9 @@
<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,5 +1,9 @@
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: 2 additions & 0 deletions exercises/concept/bird-watcher/.meta/Exemplar.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using System;

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

class BirdCount
{
private int[] birdsPerDay;
Expand Down
5 changes: 0 additions & 5 deletions exercises/concept/bird-watcher/BirdWatcher.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,9 @@
<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: 1 addition & 0 deletions exercises/concept/bird-watcher/BirdWatcherTests.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using Xunit;
using Exercism.Tests;

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

static class Appointment
{
public static DateTime Schedule(string appointmentDateDescription)
Expand Down
2 changes: 2 additions & 0 deletions exercises/concept/booking-up-for-beauty/BookingUpForBeauty.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
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,14 +3,9 @@
<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,8 @@
using Xunit;
using Exercism.Tests;

using System;
using System.Globalization;
using System.Threading;

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


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

public class RemoteControlCar
{
private int batteryPercentage = 100;
Expand Down
5 changes: 0 additions & 5 deletions exercises/concept/building-telemetry/BuildingTelemetry.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,9 @@
<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,3 +1,4 @@
using Xunit;
using Exercism.Tests;

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

public static class SimpleCalculator
{
public static string Calculate(int operand1, int operand2, string? operation)
Expand Down
2 changes: 2 additions & 0 deletions exercises/concept/calculator-conundrum/CalculatorConundrum.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
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,14 +3,9 @@
<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,6 @@
using Xunit;
using Exercism.Tests;
using System;

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

static class AssemblyLine
{
public static double SuccessRate(int speed)
Expand Down
5 changes: 0 additions & 5 deletions exercises/concept/cars-assemble/CarsAssemble.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,9 @@
<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: 1 addition & 0 deletions exercises/concept/cars-assemble/CarsAssembleTests.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using Xunit;
using Exercism.Tests;

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

public class Authenticator
{
public Identity Admin { get; } = new Identity
Expand Down
3 changes: 3 additions & 0 deletions exercises/concept/developer-privileges/DeveloperPrivileges.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
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,14 +3,9 @@
<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,3 +1,4 @@
using Xunit;
using Exercism.Tests;

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

class RemoteControlCar
{
public static RemoteControlCar Buy()
Expand Down
5 changes: 0 additions & 5 deletions exercises/concept/elons-toys/ElonsToys.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,9 @@
<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: 1 addition & 0 deletions exercises/concept/elons-toys/ElonsToysTests.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using Xunit;
using Exercism.Tests;

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

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

public class FacialFeatures
{
public string EyeColor { get; }
Expand Down
5 changes: 0 additions & 5 deletions exercises/concept/faceid-2/Faceid2.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,9 @@
<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: 1 addition & 0 deletions exercises/concept/faceid-2/Faceid2Tests.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using Xunit;
using Exercism.Tests;

public class Faceid2Tests
Expand Down
Loading

0 comments on commit 2afd127

Please sign in to comment.