diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..856c1283 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,3 @@ +# Code of Conduct + +MiniExcel is part of the [.NET Foundation](https://dotnetfoundation.org/), and we ask our contributors to abide by their [Code of Conduct](https://www.dotnetfoundation.org/code-of-conduct). diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..872cee50 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,52 @@ +# Contributing to MiniExcel + +Thank you for your enthusiasm and generosity in wanting to contribute to the project! + +We kindly ask you to follow the guidelines hereby specified. + +## Reporting an issue + +Bugs are tracked via [GitHub issues](https://github.com/mini-software/miniexcel/issues/). +The issue template will help you on the way to create a new one: + +* Create an issue via the [issues list](https://github.com/mini-software/miniexcel/issues/new?template=bug_report.md) +* Include the versions of MiniExcel that are affected +* Specify the target framework and operating system +* Describe the differences between the expected behaviour and the actual behaviour +* Provide a minimum code sample that reproduces the issue + +## Requesting a feature/enhancement + +Similarly, feature requests are also tracked via [GitHub](https://github.com/mini-software/miniexcel/issues/) issues. +The issue template will help you on the way once again: + +* Create an issue via the [issues list](https://github.com/mini-software/MiniExcel/issues/new?template=feature_request.md) +* Explain your motivations for the feature to be included +* Describe how the feature would work +* Include workarounds where applicable + +## Making a PR + +**Please do not open a PR that does not reference an issue**. +* If an issue does not already exist please create one via the issues list +* Fork the repository and create a branch with a descriptive name +* Attempt to make commits of logical units +* Verify the solution builds successfully and all tests pass +* Create the PR making sure: + * It references the issue addressed by the PR + * Unit tests for the changes have been added + * Documentation has been updated where necessary + +## AI Usage + +The use of AI agents is allowed for generating bugfixes, unit tests and documentation. +Please make sure to review all AI contributions submitted on your behalf. + +We kindly ask you to refrain from using AI to generate new features, +as it becomes increasingly difficult and time-consuming for the maintainers to review them, integrate them appropriately into the codebase, and ultimately maintain them indefinitely. + +## Questions? + +Feel free to open a discussion or contact the maintainers directly via email if you have further inquiries. + +Finally, when contributing please keep in mind our [Code of Conduct](CODE_OF_CONDUCT.md). diff --git a/MiniExcel.slnx b/MiniExcel.slnx index a34ae0b2..d87561a9 100644 --- a/MiniExcel.slnx +++ b/MiniExcel.slnx @@ -1,7 +1,9 @@ + + @@ -11,18 +13,22 @@ + + + + - - + + @@ -33,9 +39,11 @@ + + diff --git a/README-V2.md b/README_V2.md similarity index 98% rename from README-V2.md rename to README_V2.md index fc5374d6..450e1fe6 100644 --- a/README-V2.md +++ b/README_V2.md @@ -196,7 +196,7 @@ await exporter.ExportAsync(outputPath, values); ### Release Notes -If you're migrating from a `1.x` version, please check the [upgrade notes](V2-upgrade-notes.md). +If you're migrating from a `1.x` version, please check the [upgrade notes](V2-Upgrade-Notes.md). You can check the full release notes [here](docs). @@ -208,12 +208,12 @@ Check what we are planning for future versions [here](https://github.com/mini-so The code for the benchmarks can be found in [MiniExcel.Benchmarks](benchmarks/MiniExcel.Benchmarks/Program.cs). -The main file used to test performance is [**Test100,000x10.xlsx**](benchmarks/MiniExcel.Benchmarks/Test1%2C000%2C000x10.xlsx), a document containing 100,000 rows * 10 columns whose cells are filled with unique strings. +The main file used to test performance is [**Test100,000x10.xlsx**](benchmarks/MiniExcel.Benchmarks/Test100%2C000x10.xlsx), a document containing 100,000 rows * 10 columns whose cells are filled with unique strings. To run all the benchmarks use: ```bash -dotnet run -project .\benchmarks\MiniExcel.Benchmarks -c Release -f net9.0 -filter * --join +dotnet run --project .\benchmarks\MiniExcel.Benchmarks -c Release -f net9.0 -filter "*" --join ``` You can find the benchmarks' results for the latest release [here](benchmarks/results). @@ -385,7 +385,7 @@ Under the hood the dynamic objects returned in a query are implemented using `Ex making it possible to cast them to `IDictionary`: ```csharp -var excelimporter = MiniExcel.Importers.GetOpenXmlImporter(); +var excelImporter = MiniExcel.Importers.GetOpenXmlImporter(); var rows = excelImporter.Query(path).Cast>(); @@ -509,7 +509,7 @@ exporter.Export(path, values); ```csharp var exporter = MiniExcel.Exporters.GetOpenXmlExporter(); -List>() values = +List> values = [ new() { { "Column1", "MiniExcel" }, { "Column2", 1 } }, new() { { "Column1", "Github" }, { "Column2", 2 } } @@ -567,7 +567,7 @@ using var connection = YourDbConnection(); var cmd = new CommandDefinition( "SELECT 'MiniExcel' AS Column1, 1 as Column2 UNION ALL SELECT 'Github', 2", - flags: CommandFlags.NoCache) + flags: CommandFlags.NoCache ); // Note: QueryAsync will throw a closed connection exception @@ -716,7 +716,7 @@ Dictionary[] value = ]; var exporter = MiniExcel.Exporters.GetOpenXmlExporter(); -exporter.Export("test.xlsx", value, configuration: config); +exporter.Export("test.xlsx", value); ``` ![image](https://user-images.githubusercontent.com/31481586/241419455-3c0aec8a-4e5f-4d83-b7ec-6572124c165d.png) @@ -1149,7 +1149,7 @@ var config = new OpenXmlConfiguration }; var templater = MiniExcel.Templaters.GetOpenXmlTemplater(); -templater.ApplyTemplate(path, templatePath, value, config) +templater.ApplyTemplate(path, templatePath, value, config); ``` ![image](https://user-images.githubusercontent.com/12729184/157464332-e316f829-54aa-4c84-a5aa-9aef337b668d.png) @@ -1252,11 +1252,11 @@ public class Dto public DateTime InDate { get; set; } } -var value = new Dto[] -{ - new Issue241Dto{ Name = "Jack", InDate = new DateTime(2021, 01, 04) }, - new Issue241Dto{ Name = "Henry", InDate = new DateTime(2020, 04, 05) } -}; +Dto[] value = +[ + new() { Name = "Jack", InDate = new DateTime(2021, 01, 04) }, + new() { Name = "Henry", InDate = new DateTime(2020, 04, 05) } +]; var exporter = MiniExcel.Exporters.GetOpenXmlExporter(); exporter.Export(path, value); @@ -1589,7 +1589,7 @@ var config = new CsvConfiguration .ToArray() }; -var importer = MiniExcel.Exporters.GetCsvImporter(); +var importer = MiniExcel.Importers.GetCsvImporter(); var rows = importer.Query(path, configuration: config).ToList(); ```