diff --git a/src/Humanizer.Tests.Shared/Bytes/ByteSizeExtensionsTests.cs b/src/Humanizer.Tests.Shared/Bytes/ByteSizeExtensionsTests.cs index 05233234e..9ccd1c074 100644 --- a/src/Humanizer.Tests.Shared/Bytes/ByteSizeExtensionsTests.cs +++ b/src/Humanizer.Tests.Shared/Bytes/ByteSizeExtensionsTests.cs @@ -1,6 +1,4 @@ -using System.Globalization; - -namespace Humanizer.Tests.Bytes +namespace Humanizer.Tests.Bytes { [UseCulture("en")] public class ByteSizeExtensionsTests diff --git a/src/Humanizer.Tests.Shared/Bytes/ParsingTests.cs b/src/Humanizer.Tests.Shared/Bytes/ParsingTests.cs index 2f09d22ba..a51adbd7c 100644 --- a/src/Humanizer.Tests.Shared/Bytes/ParsingTests.cs +++ b/src/Humanizer.Tests.Shared/Bytes/ParsingTests.cs @@ -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")] diff --git a/src/Humanizer.Tests.Shared/DateHumanize.cs b/src/Humanizer.Tests.Shared/DateHumanize.cs index 65e0cc75b..a18628f22 100644 --- a/src/Humanizer.Tests.Shared/DateHumanize.cs +++ b/src/Humanizer.Tests.Shared/DateHumanize.cs @@ -1,6 +1,4 @@ -using System.Globalization; - -namespace Humanizer.Tests +namespace Humanizer.Tests { public class DateHumanize { diff --git a/src/Humanizer.Tests.Shared/DateHumanizeDefaultStrategyTests.cs b/src/Humanizer.Tests.Shared/DateHumanizeDefaultStrategyTests.cs index 71eb44927..ab753b7e1 100644 --- a/src/Humanizer.Tests.Shared/DateHumanizeDefaultStrategyTests.cs +++ b/src/Humanizer.Tests.Shared/DateHumanizeDefaultStrategyTests.cs @@ -1,6 +1,4 @@ -using System.Globalization; - -namespace Humanizer.Tests +namespace Humanizer.Tests { [UseCulture("en-US")] public class DateHumanizeDefaultStrategyTests diff --git a/src/Humanizer.Tests.Shared/HeadingTests.cs b/src/Humanizer.Tests.Shared/HeadingTests.cs index db85d3406..9c07303f8 100644 --- a/src/Humanizer.Tests.Shared/HeadingTests.cs +++ b/src/Humanizer.Tests.Shared/HeadingTests.cs @@ -1,6 +1,4 @@ -using System.Globalization; - -namespace Humanizer.Tests +namespace Humanizer.Tests { [UseCulture("en-US")] public class HeadingTests diff --git a/src/Humanizer.Tests.Shared/Localisation/ResourcesTests.cs b/src/Humanizer.Tests.Shared/Localisation/ResourcesTests.cs index 7692dae88..c72b5ff16 100644 --- a/src/Humanizer.Tests.Shared/Localisation/ResourcesTests.cs +++ b/src/Humanizer.Tests.Shared/Localisation/ResourcesTests.cs @@ -1,6 +1,4 @@ -using System.Globalization; - -namespace Humanizer.Tests.Localisation +namespace Humanizer.Tests.Localisation { public class ResourcesTests { diff --git a/src/Humanizer.Tests.Shared/Localisation/af/NumberToWordsTests.cs b/src/Humanizer.Tests.Shared/Localisation/af/NumberToWordsTests.cs index 6e54cbfa3..f0c52e414 100644 --- a/src/Humanizer.Tests.Shared/Localisation/af/NumberToWordsTests.cs +++ b/src/Humanizer.Tests.Shared/Localisation/af/NumberToWordsTests.cs @@ -1,6 +1,4 @@ -using System.Globalization; - -namespace Humanizer.Tests.Localisation.af +namespace Humanizer.Tests.Localisation.af { [UseCulture("af")] public class AfrikaansNumberToWordsTests diff --git a/src/Humanizer.Tests.Shared/Localisation/es/OrdinalizeTests.cs b/src/Humanizer.Tests.Shared/Localisation/es/OrdinalizeTests.cs index 7a8077237..9ee613913 100644 --- a/src/Humanizer.Tests.Shared/Localisation/es/OrdinalizeTests.cs +++ b/src/Humanizer.Tests.Shared/Localisation/es/OrdinalizeTests.cs @@ -1,6 +1,4 @@ -using System.Globalization; - -namespace Humanizer.Tests.Localisation.es +namespace Humanizer.Tests.Localisation.es { [UseCulture("es-ES")] public class OrdinalizeTests diff --git a/src/Humanizer.Tests.Shared/Localisation/es/TimeSpanHumanizeTests.cs b/src/Humanizer.Tests.Shared/Localisation/es/TimeSpanHumanizeTests.cs index 190629742..0f6cdc745 100644 --- a/src/Humanizer.Tests.Shared/Localisation/es/TimeSpanHumanizeTests.cs +++ b/src/Humanizer.Tests.Shared/Localisation/es/TimeSpanHumanizeTests.cs @@ -1,6 +1,4 @@ -using System.Globalization; - -namespace Humanizer.Tests.Localisation.es +namespace Humanizer.Tests.Localisation.es { [UseCulture("es-ES")] public class TimeSpanHumanizeTests diff --git a/src/Humanizer.Tests.Shared/Localisation/is/ResourcesTests.cs b/src/Humanizer.Tests.Shared/Localisation/is/ResourcesTests.cs index 55228eb24..e927d8a2a 100644 --- a/src/Humanizer.Tests.Shared/Localisation/is/ResourcesTests.cs +++ b/src/Humanizer.Tests.Shared/Localisation/is/ResourcesTests.cs @@ -1,6 +1,4 @@ -using System.Globalization; - -namespace Humanizer.Tests.Localisation.@is +namespace Humanizer.Tests.Localisation.@is { public class ResourcesTests { diff --git a/src/Humanizer.Tests.Shared/MetricNumeralTests.cs b/src/Humanizer.Tests.Shared/MetricNumeralTests.cs index 82168bcbf..53d2f9edf 100644 --- a/src/Humanizer.Tests.Shared/MetricNumeralTests.cs +++ b/src/Humanizer.Tests.Shared/MetricNumeralTests.cs @@ -1,7 +1,4 @@ -using System.Diagnostics; -using System.Globalization; - -namespace Humanizer.Tests +namespace Humanizer.Tests { [UseCulture("en-US")] public class MetricNumeralTests diff --git a/src/Humanizer.Tests.Shared/NumberToWordsTests.cs b/src/Humanizer.Tests.Shared/NumberToWordsTests.cs index 7f72266b0..98e2f8d08 100644 --- a/src/Humanizer.Tests.Shared/NumberToWordsTests.cs +++ b/src/Humanizer.Tests.Shared/NumberToWordsTests.cs @@ -1,6 +1,4 @@ -using System.Globalization; - -namespace Humanizer.Tests +namespace Humanizer.Tests { [UseCulture("en-US")] public class NumberToWordsTests diff --git a/src/Humanizer.Tests.Shared/OrdinalizeTests.cs b/src/Humanizer.Tests.Shared/OrdinalizeTests.cs index 53668e0b9..d707bba9c 100644 --- a/src/Humanizer.Tests.Shared/OrdinalizeTests.cs +++ b/src/Humanizer.Tests.Shared/OrdinalizeTests.cs @@ -1,6 +1,4 @@ -using System.Globalization; - -namespace Humanizer.Tests +namespace Humanizer.Tests { [UseCulture("en-US")] public class OrdinalizeTests diff --git a/src/Humanizer.Tests.Shared/StringExtensionsTests.cs b/src/Humanizer.Tests.Shared/StringExtensionsTests.cs index d6deebe20..7e1b7ec73 100644 --- a/src/Humanizer.Tests.Shared/StringExtensionsTests.cs +++ b/src/Humanizer.Tests.Shared/StringExtensionsTests.cs @@ -1,6 +1,4 @@ -using System.Globalization; - -namespace Humanizer.Tests +namespace Humanizer.Tests { public class StringExtensionsTests { diff --git a/src/Humanizer.Tests.Shared/TimeSpanHumanizeTests.cs b/src/Humanizer.Tests.Shared/TimeSpanHumanizeTests.cs index 195e4e3ca..6f76c87c7 100644 --- a/src/Humanizer.Tests.Shared/TimeSpanHumanizeTests.cs +++ b/src/Humanizer.Tests.Shared/TimeSpanHumanizeTests.cs @@ -1,6 +1,4 @@ -using System.Globalization; - -namespace Humanizer.Tests +namespace Humanizer.Tests { [UseCulture("en-US")] public class TimeSpanHumanizeTests diff --git a/src/Humanizer.Tests.Shared/ToQuantityTests.cs b/src/Humanizer.Tests.Shared/ToQuantityTests.cs index 5f10c0e17..ebe31ceda 100644 --- a/src/Humanizer.Tests.Shared/ToQuantityTests.cs +++ b/src/Humanizer.Tests.Shared/ToQuantityTests.cs @@ -1,6 +1,4 @@ -using System.Globalization; - -namespace Humanizer.Tests +namespace Humanizer.Tests { [UseCulture("en-US")] public class ToQuantityTests diff --git a/src/Humanizer.Tests.Shared/UseCultureAttribute.cs b/src/Humanizer.Tests.Shared/UseCultureAttribute.cs index 6e0114c8d..f285a2bba 100644 --- a/src/Humanizer.Tests.Shared/UseCultureAttribute.cs +++ b/src/Humanizer.Tests.Shared/UseCultureAttribute.cs @@ -1,5 +1,4 @@ -using System.Globalization; -using System.Reflection; +using System.Reflection; using Xunit.Sdk; namespace Humanizer.Tests diff --git a/src/Humanizer.Tests/GlobalUsings.cs b/src/Humanizer.Tests/GlobalUsings.cs new file mode 100644 index 000000000..d47e57784 --- /dev/null +++ b/src/Humanizer.Tests/GlobalUsings.cs @@ -0,0 +1,5 @@ +// Global using directives + +global using System.Globalization; +global using System.Runtime.CompilerServices; +global using System.Diagnostics; \ No newline at end of file diff --git a/src/Humanizer.Tests/ModuleInitializer.cs b/src/Humanizer.Tests/ModuleInitializer.cs index 11d654959..1ae0faeb9 100644 --- a/src/Humanizer.Tests/ModuleInitializer.cs +++ b/src/Humanizer.Tests/ModuleInitializer.cs @@ -1,6 +1,4 @@ -using System.Runtime.CompilerServices; - -using VerifyTests.DiffPlex; +using VerifyTests.DiffPlex; public static class ModuleInitializer { diff --git a/src/Humanizer/ArticlePrefixSort.cs b/src/Humanizer/ArticlePrefixSort.cs index f3f0029ce..a75ac36c0 100644 --- a/src/Humanizer/ArticlePrefixSort.cs +++ b/src/Humanizer/ArticlePrefixSort.cs @@ -1,6 +1,4 @@ -using System.Text.RegularExpressions; - -namespace Humanizer +namespace Humanizer { /// /// Contains methods for removing, appending and prepending article prefixes for sorting strings ignoring the article. diff --git a/src/Humanizer/Configuration/Configurator.cs b/src/Humanizer/Configuration/Configurator.cs index 4df0417cb..4c3ca335f 100644 --- a/src/Humanizer/Configuration/Configurator.cs +++ b/src/Humanizer/Configuration/Configurator.cs @@ -1,6 +1,4 @@ -using System.Reflection; - -namespace Humanizer +namespace Humanizer { /// /// Provides a configuration point for Humanizer diff --git a/src/Humanizer/EnumHumanizeExtensions.cs b/src/Humanizer/EnumHumanizeExtensions.cs index 994d5ab5d..afe20d209 100644 --- a/src/Humanizer/EnumHumanizeExtensions.cs +++ b/src/Humanizer/EnumHumanizeExtensions.cs @@ -1,5 +1,4 @@ -using System.Reflection; -using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations; namespace Humanizer { diff --git a/src/Humanizer/GlobalUsings.cs b/src/Humanizer/GlobalUsings.cs index d9c83e937..5d817a32a 100644 --- a/src/Humanizer/GlobalUsings.cs +++ b/src/Humanizer/GlobalUsings.cs @@ -1,2 +1,4 @@ global using System.Globalization; +global using System.Reflection; +global using System.Text; global using System.Text.RegularExpressions; \ No newline at end of file diff --git a/src/Humanizer/InflectorExtensions.cs b/src/Humanizer/InflectorExtensions.cs index b5922d737..b09d24bab 100644 --- a/src/Humanizer/InflectorExtensions.cs +++ b/src/Humanizer/InflectorExtensions.cs @@ -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 { /// diff --git a/src/Humanizer/Localisation/Formatters/RomanianFormatter.cs b/src/Humanizer/Localisation/Formatters/RomanianFormatter.cs index 5e7fccdbe..d52a7e12f 100644 --- a/src/Humanizer/Localisation/Formatters/RomanianFormatter.cs +++ b/src/Humanizer/Localisation/Formatters/RomanianFormatter.cs @@ -1,7 +1,5 @@ namespace Humanizer { - using System; - internal class RomanianFormatter() : DefaultFormatter(RomanianCultureCode) { diff --git a/src/Humanizer/Localisation/NumberToWords/UzbekCyrlNumberToWordConverter.cs b/src/Humanizer/Localisation/NumberToWords/UzbekCyrlNumberToWordConverter.cs index 7b115afb0..087423f69 100644 --- a/src/Humanizer/Localisation/NumberToWords/UzbekCyrlNumberToWordConverter.cs +++ b/src/Humanizer/Localisation/NumberToWords/UzbekCyrlNumberToWordConverter.cs @@ -1,6 +1,4 @@ -using System.Text; - -namespace Humanizer +namespace Humanizer { internal class UzbekCyrlNumberToWordConverter : GenderlessNumberToWordsConverter { diff --git a/src/Humanizer/Localisation/NumberToWords/UzbekLatnNumberToWordConverter.cs b/src/Humanizer/Localisation/NumberToWords/UzbekLatnNumberToWordConverter.cs index 015edb805..694a56828 100644 --- a/src/Humanizer/Localisation/NumberToWords/UzbekLatnNumberToWordConverter.cs +++ b/src/Humanizer/Localisation/NumberToWords/UzbekLatnNumberToWordConverter.cs @@ -1,6 +1,4 @@ -using System.Text; - -namespace Humanizer +namespace Humanizer { internal class UzbekLatnNumberToWordConverter : GenderlessNumberToWordsConverter { diff --git a/src/Humanizer/Localisation/Resources.cs b/src/Humanizer/Localisation/Resources.cs index 69bf91b37..44f60da37 100644 --- a/src/Humanizer/Localisation/Resources.cs +++ b/src/Humanizer/Localisation/Resources.cs @@ -1,5 +1,4 @@ -using System.Reflection; -using System.Resources; +using System.Resources; namespace Humanizer { diff --git a/src/Humanizer/RegexOptionsUtil.cs b/src/Humanizer/RegexOptionsUtil.cs index 10fcfd583..4c8311339 100644 --- a/src/Humanizer/RegexOptionsUtil.cs +++ b/src/Humanizer/RegexOptionsUtil.cs @@ -1,5 +1,3 @@ -using System.Text.RegularExpressions; - namespace Humanizer { internal static class RegexOptionsUtil diff --git a/src/Humanizer/RomanNumeralExtensions.cs b/src/Humanizer/RomanNumeralExtensions.cs index 929a2c9f4..265cc7809 100644 --- a/src/Humanizer/RomanNumeralExtensions.cs +++ b/src/Humanizer/RomanNumeralExtensions.cs @@ -1,8 +1,5 @@ // Done by Jesse Slicer https://github.com/jslicer -using System.Text; -using System.Text.RegularExpressions; - namespace Humanizer { /// diff --git a/src/Humanizer/StringHumanizeExtensions.cs b/src/Humanizer/StringHumanizeExtensions.cs index bd3d04025..f95b20ebf 100644 --- a/src/Humanizer/StringHumanizeExtensions.cs +++ b/src/Humanizer/StringHumanizeExtensions.cs @@ -1,6 +1,4 @@ -using System.Text.RegularExpressions; - -namespace Humanizer +namespace Humanizer { /// /// Contains extension methods for humanizing string values. diff --git a/src/Humanizer/Transformer/ToTitleCase.cs b/src/Humanizer/Transformer/ToTitleCase.cs index 8065f03b8..4163d3053 100644 --- a/src/Humanizer/Transformer/ToTitleCase.cs +++ b/src/Humanizer/Transformer/ToTitleCase.cs @@ -1,6 +1,4 @@ -using System.Text.RegularExpressions; - -namespace Humanizer +namespace Humanizer { internal class ToTitleCase : ICulturedStringTransformer {