Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Global usings #1359

Merged
merged 4 commits into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/Humanizer.Tests.Shared/Bytes/ByteSizeExtensionsTests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.Globalization;

namespace Humanizer.Tests.Bytes
namespace Humanizer.Tests.Bytes
{
[UseCulture("en")]
public class ByteSizeExtensionsTests
Expand Down
2 changes: 0 additions & 2 deletions src/Humanizer.Tests.Shared/Bytes/ParsingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
//OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
//THE SOFTWARE.

using System.Globalization;

namespace Humanizer.Tests.Bytes
{
[UseCulture("en")]
Expand Down
4 changes: 1 addition & 3 deletions src/Humanizer.Tests.Shared/DateHumanize.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.Globalization;

namespace Humanizer.Tests
namespace Humanizer.Tests
{
public class DateHumanize
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.Globalization;

namespace Humanizer.Tests
namespace Humanizer.Tests
{
[UseCulture("en-US")]
public class DateHumanizeDefaultStrategyTests
Expand Down
4 changes: 1 addition & 3 deletions src/Humanizer.Tests.Shared/HeadingTests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.Globalization;

namespace Humanizer.Tests
namespace Humanizer.Tests
{
[UseCulture("en-US")]
public class HeadingTests
Expand Down
4 changes: 1 addition & 3 deletions src/Humanizer.Tests.Shared/Localisation/ResourcesTests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.Globalization;

namespace Humanizer.Tests.Localisation
namespace Humanizer.Tests.Localisation
{
public class ResourcesTests
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.Globalization;

namespace Humanizer.Tests.Localisation.af
namespace Humanizer.Tests.Localisation.af
{
[UseCulture("af")]
public class AfrikaansNumberToWordsTests
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.Globalization;

namespace Humanizer.Tests.Localisation.es
namespace Humanizer.Tests.Localisation.es
{
[UseCulture("es-ES")]
public class OrdinalizeTests
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.Globalization;

namespace Humanizer.Tests.Localisation.es
namespace Humanizer.Tests.Localisation.es
{
[UseCulture("es-ES")]
public class TimeSpanHumanizeTests
Expand Down
4 changes: 1 addition & 3 deletions src/Humanizer.Tests.Shared/Localisation/is/ResourcesTests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.Globalization;

namespace Humanizer.Tests.Localisation.@is
namespace Humanizer.Tests.Localisation.@is
{
public class ResourcesTests
{
Expand Down
5 changes: 1 addition & 4 deletions src/Humanizer.Tests.Shared/MetricNumeralTests.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System.Diagnostics;
using System.Globalization;

namespace Humanizer.Tests
namespace Humanizer.Tests
{
[UseCulture("en-US")]
public class MetricNumeralTests
Expand Down
4 changes: 1 addition & 3 deletions src/Humanizer.Tests.Shared/NumberToWordsTests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.Globalization;

namespace Humanizer.Tests
namespace Humanizer.Tests
{
[UseCulture("en-US")]
public class NumberToWordsTests
Expand Down
4 changes: 1 addition & 3 deletions src/Humanizer.Tests.Shared/OrdinalizeTests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.Globalization;

namespace Humanizer.Tests
namespace Humanizer.Tests
{
[UseCulture("en-US")]
public class OrdinalizeTests
Expand Down
4 changes: 1 addition & 3 deletions src/Humanizer.Tests.Shared/StringExtensionsTests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.Globalization;

namespace Humanizer.Tests
namespace Humanizer.Tests
{
public class StringExtensionsTests
{
Expand Down
4 changes: 1 addition & 3 deletions src/Humanizer.Tests.Shared/TimeSpanHumanizeTests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.Globalization;

namespace Humanizer.Tests
namespace Humanizer.Tests
{
[UseCulture("en-US")]
public class TimeSpanHumanizeTests
Expand Down
4 changes: 1 addition & 3 deletions src/Humanizer.Tests.Shared/ToQuantityTests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.Globalization;

namespace Humanizer.Tests
namespace Humanizer.Tests
{
[UseCulture("en-US")]
public class ToQuantityTests
Expand Down
3 changes: 1 addition & 2 deletions src/Humanizer.Tests.Shared/UseCultureAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Globalization;
using System.Reflection;
using System.Reflection;
using Xunit.Sdk;

namespace Humanizer.Tests
Expand Down
5 changes: 5 additions & 0 deletions src/Humanizer.Tests/GlobalUsings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Global using directives

global using System.Globalization;
global using System.Runtime.CompilerServices;
global using System.Diagnostics;
4 changes: 1 addition & 3 deletions src/Humanizer.Tests/ModuleInitializer.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.Runtime.CompilerServices;

using VerifyTests.DiffPlex;
using VerifyTests.DiffPlex;

public static class ModuleInitializer
{
Expand Down
4 changes: 1 addition & 3 deletions src/Humanizer/ArticlePrefixSort.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.Text.RegularExpressions;

namespace Humanizer
namespace Humanizer
{
/// <summary>
/// Contains methods for removing, appending and prepending article prefixes for sorting strings ignoring the article.
Expand Down
4 changes: 1 addition & 3 deletions src/Humanizer/Configuration/Configurator.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.Reflection;

namespace Humanizer
namespace Humanizer
{
/// <summary>
/// Provides a configuration point for Humanizer
Expand Down
3 changes: 1 addition & 2 deletions src/Humanizer/EnumHumanizeExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Reflection;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations;

namespace Humanizer
{
Expand Down
2 changes: 2 additions & 0 deletions src/Humanizer/GlobalUsings.cs
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
global using System.Globalization;
global using System.Reflection;
global using System.Text;
global using System.Text.RegularExpressions;
2 changes: 0 additions & 2 deletions src/Humanizer/InflectorExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
//IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
//CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

using System.Text.RegularExpressions;

namespace Humanizer
{
/// <summary>
Expand Down
2 changes: 0 additions & 2 deletions src/Humanizer/Localisation/Formatters/RomanianFormatter.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
namespace Humanizer
{
using System;

internal class RomanianFormatter() :
DefaultFormatter(RomanianCultureCode)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.Text;

namespace Humanizer
namespace Humanizer
{
internal class UzbekCyrlNumberToWordConverter : GenderlessNumberToWordsConverter
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.Text;

namespace Humanizer
namespace Humanizer
{
internal class UzbekLatnNumberToWordConverter : GenderlessNumberToWordsConverter
{
Expand Down
3 changes: 1 addition & 2 deletions src/Humanizer/Localisation/Resources.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Reflection;
using System.Resources;
using System.Resources;

namespace Humanizer
{
Expand Down
2 changes: 0 additions & 2 deletions src/Humanizer/RegexOptionsUtil.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System.Text.RegularExpressions;

namespace Humanizer
{
internal static class RegexOptionsUtil
Expand Down
3 changes: 0 additions & 3 deletions src/Humanizer/RomanNumeralExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
// Done by Jesse Slicer https://github.com/jslicer

using System.Text;
using System.Text.RegularExpressions;

namespace Humanizer
{
/// <summary>
Expand Down
4 changes: 1 addition & 3 deletions src/Humanizer/StringHumanizeExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.Text.RegularExpressions;

namespace Humanizer
namespace Humanizer
{
/// <summary>
/// Contains extension methods for humanizing string values.
Expand Down
4 changes: 1 addition & 3 deletions src/Humanizer/Transformer/ToTitleCase.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.Text.RegularExpressions;

namespace Humanizer
namespace Humanizer
{
internal class ToTitleCase : ICulturedStringTransformer
{
Expand Down