FiFi.Lib 0.3.0

dotnet add package FiFi.Lib --version 0.3.0
NuGet\Install-Package FiFi.Lib -Version 0.3.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="FiFi.Lib" Version="0.3.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add FiFi.Lib --version 0.3.0
#r "nuget: FiFi.Lib, 0.3.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install FiFi.Lib as a Cake Addin
#addin nuget:?package=FiFi.Lib&version=0.3.0

// Install FiFi.Lib as a Cake Tool
#tool nuget:?package=FiFi.Lib&version=0.3.0
Introduction

FiFi is a File Fixer library that can be used to fix files for the following

  • consistent Line Endings,
  • File Encoding
  • Remove Invalid ASCII characters.

It provides an easy to use Fluent API's that can be easily setup and called in couple of lines of code. FiFi is based on .NET standard 2.1 and can run in .NET Core 3.0 and .NET Core 4.6.1 or above

Usage
            //First define the list of files that you want to fix
            var fileSources = FileSources.New()
                .Add(directory, "*.cs")
                .Add("/users/sdha/file.xml")
                .Add(new[] {"/users/duck/boo.bar","/opt/exe/foo.sh"});

            //Now configure FiFi with the list of fixers to run on the files mentioned above
            var runner = FiFiRunner.New()
                .FixEncoding(Encoding.UTF8)
                .FixInvalidCharacters()
                .FixLineEndings(LineEndingMode.Windows)
                .ForFiles(fileSources);

            if(!runner.Success())
            {
                foreach(var result in runner.FileResults) //Enumerate all files that failed to perform
                {
                    Console.WriteLine(result.FileName);
                    foreach(var fixer in result.Fixers) //Enumerate all the fixers for a file that failed
                    {
                           Console.WriteLine(fixer.Exception);
                    }
                }
            }


The above code fragment will take the list of files and run the fixers on those files. The fixers configured in the above file are Encoding, InvalidChars and LineEndings. You can ignore a fixer by not calling it (ignoring it). When complete, you can enumerate through the results and see what succeeded and failed , exceptions etc.,

Disclaimer

This is a community package and i don't hold any accountability for the code, it's success and failures. Use it with your own discreation. I don't mind if oyou fork and use it by yourself.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.1

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.3.0 418 8/22/2020
0.2.0 396 7/17/2020

* When the runner is complete, now it will return an object that represents the details of the run like success, failure, exceptions
* The runner will capture exceptions as they occure and continue execution (against terminating in the past). At the end you can enumerate through the result object and see those exceptions.