https://github.com/editorconfig/editorconfig-core-net
  
  
    EditorConfig Core library and command line utility written in C# for .NET/Mono  http://editorconfig.org 
    https://github.com/editorconfig/editorconfig-core-net
  
        Last synced: about 1 month ago 
        JSON representation
    
EditorConfig Core library and command line utility written in C# for .NET/Mono http://editorconfig.org
- Host: GitHub
 - URL: https://github.com/editorconfig/editorconfig-core-net
 - Owner: editorconfig
 - License: mit
 - Created: 2014-11-27T22:07:23.000Z (almost 11 years ago)
 - Default Branch: master
 - Last Pushed: 2025-06-09T13:08:13.000Z (5 months ago)
 - Last Synced: 2025-08-30T23:36:44.721Z (2 months ago)
 - Language: C#
 - Size: 446 KB
 - Stars: 86
 - Watchers: 11
 - Forks: 38
 - Open Issues: 5
 - 
            Metadata Files:
            
- Readme: README.md
 - License: LICENSE
 
 
Awesome Lists containing this project
- jimsghstars - editorconfig/editorconfig-core-net - EditorConfig Core library and command line utility written in C# for .NET/Mono http://editorconfig.org (C# #)
 
README
          # EditorConfig .NET Core
The EditorConfig .NET core provides the same functionality as the
[EditorConfig C Core][] and [EditorConfig Python Core][].
## Installation
The library exists on nuget as: 
```
nuget install editorconfig
```
The .NET core tool exists under:
```
dotnet tool install editorconfig-tool
```
## Usage
Usage as a library:
```csharp
var parser = new EditorConfigParser();
var configuration = parser.Parse(fileName);
foreach (var kv in configuration.Properties)
{
    Console.WriteLine("{0}={1}", kv.Key, kv.Value);
}
```
Usage as a command line tool:
You can omit `dotnet` if you install this as a global tool
```
> dotnet editorconfig
    Usage: editorconfig [OPTIONS] FILEPATH1 [FILEPATH2 FILEPATH3 ...]
    EditorConfig .NET Core Version 0.12
    FILEPATH can be a hyphen (-) if you want path(s) to be read from stdin.
    Options:
        -h, --help     output usage information
        -V, --version  output the version number
        -f       Specify conf filename other than ".editorconfig"
        -b    Specify version (used by devs to test compatibility)
```
Example:
    > dotnet editorconfig C:\Users\zoidberg\Documents\anatomy.md
    charset=utf-8
    insert_final_newline=true
    end_of_line=lf
    tab_width=8
    trim_trailing_whitespace=sometimes
## Development
Clone this repos and init the test submodule
```
git clone git@github.com:editorconfig/editorconfig-core-net.git
git submodule init
git submodule update
```
building in visual studio should just work (tm)
Building on the command line (will run all the unit tests too)
```
build
```
Release builds can be made using
```
build release X.X.X
```
# Testing
We have several NUnit tests that you can run from visual studio or the build scripts. 
If you want to run the official editorconfig tests you'll need to install [CMAKE](http://www.cmake.org) and call
```
cmake .
``` 
in the root of this repository once.
After which you can simply call 
```
ctest .
```
To run the official editorconfig tests located in `/tests` right now we pass all but one related to utf-8 which fails 
when run from `ctest .` but when I run it directly from the commandline it succeeds.
[EditorConfig C Core]: https://github.com/editorconfig/editorconfig-core
[EditorConfig Python Core]: https://github.com/editorconfig/editorconfig-core-py
[cmake]: http://www.cmake.org