diff --git a/GitVersion.yml b/GitVersion.yml index 89b0a62..3f9ebba 100644 --- a/GitVersion.yml +++ b/GitVersion.yml @@ -1,4 +1,4 @@ -next-version: 1.0.0 +next-version: 1.0.1 tag-prefix: '[vV]' mode: ContinuousDeployment branches: diff --git a/README.md b/README.md index 92fe12b..b9ee849 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,11 @@ -# ninja Parsley.Net v1.0.0 +# ninja Parsley.Net v1.0.1 [![NuGet version](https://badge.fury.io/nu/Parsley.Net.svg)](https://badge.fury.io/nu/Parsley.Net) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/CodeShayk/Parsley.Net/blob/master/LICENSE.md) [![GitHub Release](https://img.shields.io/github/v/release/CodeShayk/Parsley.Net?logo=github&sort=semver)](https://github.com/CodeShayk/Parsley.Net/releases/latest) [![master-build](https://github.com/CodeShayk/parsley.net/actions/workflows/Master-Build.yml/badge.svg)](https://github.com/CodeShayk/parsley.net/actions/workflows/Master-Build.yml) [![master-codeql](https://github.com/CodeShayk/parsley.net/actions/workflows/Master-CodeQL.yml/badge.svg)](https://github.com/CodeShayk/parsley.net/actions/workflows/Master-CodeQL.yml) [![.Net 9.0](https://img.shields.io/badge/.Net-9.0-blue)](https://dotnet.microsoft.com/en-us/download/dotnet/9.0) +[![.Net Framework 4.6.4](https://img.shields.io/badge/.Net-4.6.2-blue)](https://dotnet.microsoft.com/en-us/download/dotnet-framework/net46) +[![.Net Standard 2.0](https://img.shields.io/badge/.NetStandard-2.0-blue)](https://github.com/dotnet/standard/blob/v2.0.0/docs/versions/netstandard2.0.md) ## Introduction ### What is Parsley.Net? diff --git a/src/Parsley/ColumnAttribute.cs b/src/Parsley/ColumnAttribute.cs index 5cba8b2..e9abf89 100644 --- a/src/Parsley/ColumnAttribute.cs +++ b/src/Parsley/ColumnAttribute.cs @@ -1,3 +1,5 @@ +using System; + namespace parsley { public class ColumnAttribute : Attribute diff --git a/src/Parsley/CustomConverter.cs b/src/Parsley/CustomConverter.cs index 6a64862..8b1b079 100644 --- a/src/Parsley/CustomConverter.cs +++ b/src/Parsley/CustomConverter.cs @@ -1,9 +1,10 @@ +using System; using System.ComponentModel; using System.Globalization; namespace parsley { - public class CustomConverter : TypeConverter where T: ICustomType, new() + public class CustomConverter : TypeConverter where T : ICustomType, new() { public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) { diff --git a/src/Parsley/Extensions.cs b/src/Parsley/Extensions.cs index 64efbe3..2a9cabd 100644 --- a/src/Parsley/Extensions.cs +++ b/src/Parsley/Extensions.cs @@ -1,3 +1,5 @@ +using System.Collections.Generic; + namespace parsley { internal static class Extensions diff --git a/src/Parsley/ICustomType.cs b/src/Parsley/ICustomType.cs index 747233e..be57bde 100644 --- a/src/Parsley/ICustomType.cs +++ b/src/Parsley/ICustomType.cs @@ -2,6 +2,6 @@ namespace parsley { public interface ICustomType { - public ICustomType Parse(string column); + ICustomType Parse(string column); } } \ No newline at end of file diff --git a/src/Parsley/IFileLine.cs b/src/Parsley/IFileLine.cs index c9330c6..596aebc 100644 --- a/src/Parsley/IFileLine.cs +++ b/src/Parsley/IFileLine.cs @@ -1,8 +1,10 @@ +using System.Collections.Generic; + namespace parsley { public interface IFileLine { - public int Index { get; set; } - public IList Errors { get; set; } + int Index { get; set; } + IList Errors { get; set; } } } \ No newline at end of file diff --git a/src/Parsley/IParser.cs b/src/Parsley/IParser.cs index e51f631..5925628 100644 --- a/src/Parsley/IParser.cs +++ b/src/Parsley/IParser.cs @@ -2,8 +2,8 @@ namespace parsley { public interface IParser { - public T[] Parse(string filepath) where T : IFileLine, new(); - - public T[] Parse(string[] lines) where T : IFileLine, new(); + T[] Parse(string filepath) where T : IFileLine, new(); + + T[] Parse(string[] lines) where T : IFileLine, new(); } } \ No newline at end of file diff --git a/src/Parsley/Parser.cs b/src/Parsley/Parser.cs index 1f81604..f9bd038 100644 --- a/src/Parsley/Parser.cs +++ b/src/Parsley/Parser.cs @@ -1,5 +1,10 @@ +using System; +using System.Collections.Generic; using System.ComponentModel; +using System.IO; +using System.Linq; using System.Reflection; +using System.Threading.Tasks; namespace parsley { @@ -19,7 +24,7 @@ public Parser(char delimiter) public T[] Parse(string filepath) where T : IFileLine, new() { if (string.IsNullOrEmpty(filepath) || !File.Exists(filepath)) - return []; + return Array.Empty(); var lines = ReadToLines(filepath); @@ -29,7 +34,8 @@ public Parser(char delimiter) public T[] Parse(string[] lines) where T : IFileLine, new() { if (lines == null || lines.Length == 0) - return []; + return Array.Empty(); + ; var list = new T[lines.Length]; @@ -70,7 +76,7 @@ private string[] ReadToLines(string path) lines.Add(line); } - return lines.ToArray(); + return lines.ToArray(); } private T ParseLine(string line) where T : IFileLine, new() diff --git a/src/Parsley/Parsley.csproj b/src/Parsley/Parsley.csproj index 89265bf..16d3b24 100644 --- a/src/Parsley/Parsley.csproj +++ b/src/Parsley/Parsley.csproj @@ -1,9 +1,8 @@  - - net9.0 - enable - enable + + net462; netstandard2.0;netstandard2.1; net9.0 + disable Parsley.Net CodeShayk CodeShayk @@ -20,9 +19,10 @@ True https://github.com/CodeShayk/Parsley.Net/wiki https://github.com/CodeShayk/Parsley.Net - v1.0 - Targets .Net9.0 + + v1.0.1 - Targets .Net9.0, .NetStandard2.1, .NetStandard2.0, and .NetFramework4.6.4.
* Includes core functionality for parsing delimiter separated files.
- 1.0.0 + 1.0.1 True Parsley.Net