question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Please apply EditorConfig settings to template files

See original GitHub issue

When creating projects and solutions using dotnet new, it doesn’t respect an existing EditorConfig file, and you end up with 2-space indentation, CRLFs, and some files (like launchSettings.json) with a BOM.

This isn’t very cross-platform-friendly. In fact, the project was added from Linux, and I still got CRLFs.

Please:

  • Read and apply settings from an existing EditorConfig file.
  • If there is no EditorConfig file, apply settings based on the OS (f.e. LF on Linux and macOS).

This should not require any parsing or understanding of the template itself. Most text-like files can have these settings applied, or you can maintain a simple list of files (file extensions) that support them.

The following EditorConfig settings should be applied:

charset end_of_line indent_size indent_style insert_final_newline trim_trailing_whitespace

This would make it easier to get started without having to spend time fixing the files.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:3
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
glen-84commented, Jun 7, 2022

@JanKrivanek

The problem with that is that dotnet format doesn’t support files like .csproj .sln, .cshtml .razor, or other template files like appsettings.json, etc.

I wonder if dotnet format should add support for basic EditorConfig formatting in all (most) file types.

1reaction
vlada-shubinacommented, May 31, 2022
Read more comments on GitHub >

github_iconTop Results From Across the Web

EditorConfig settings - Visual Studio (Windows)
Settings in EditorConfig files let you maintain consistent coding styles and settings in a codebase, such as indent style, tab width, ...
Read more >
How to import an EditorConfig file into Visual Studio for all ...
From the menu bar, choose Project > Add New Item; or press Ctrl+Shift+A · Select the editorconfig File (.NET) template to add an...
Read more >
Working with EditorConfig in Visual Studio 2019
Select the Visual C# category and Text File template. Set the Name to “.editorconfig” and click Add. For this folder we'll override some...
Read more >
EditorConfig
EditorConfig is a file format and collection of text editor plugins for maintaining consistent coding styles between different editors and IDEs.
Read more >
What is .editorconfig - EditorConfig full Guide - YouTube
In this video I will explain what is . editorconfig file ? How you can configure it? What advantages it has. EditorConfig is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found