You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Steps to reproduce:
Have a broken .editorconfig in the file tree, run format.
Expected behavior:
Not sure, my current best idea is to ignore broken .editorconfig files with a warning.
In my case the file is installed by npm, so I cannot simply fix or remove it.
Also, the current exception does not provide the broken config location, only the repo root folder name.
Actual behavior:
❯ dotnet csharpier .
Error Failure parsing editorconfig files for <edited>
Unknown file format. Couldn't parse the line: 'View'. while parsing line number 0 with value '' - IniParser version: 2.5.2.0 while parsing line number 16 with value 'View' - IniParser version: 2.5.2.0
at IniParser.Parser.IniDataParser.Parse(String iniDataString)
at IniParser.StreamIniDataParser.ReadData(StreamReader reader)
at CSharpier.Cli.EditorConfig.ConfigFileParser.Parse(String filePath, IFileSystem fileSystem) in /home/runner/work/csharpier/csharpier/Src/CSharpier.Cli/EditorConfig/ConfigFileParser.cs:line 30
at CSharpier.Cli.EditorConfig.EditorConfigParser.ParseConfigFiles(String directoryPath, IFileSystem fileSystem)+MoveNext() in /home/runner/work/csharpier/csharpier/Src/CSharpier.Cli/EditorConfig/EditorConfigParser.cs:line 85
at System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable`1 source, Int32& length)
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ReverseIterator`1.MoveNext()
at System.Linq.Enumerable.SelectManySingleSelectorIterator`2.ToList()
at CSharpier.Cli.EditorConfig.EditorConfigParser.FindSections(String filePath, IFileSystem fileSystem) in /home/runner/work/csharpier/csharpier/Src/CSharpier.Cli/EditorConfig/EditorConfigParser.cs:line 68
at CSharpier.Cli.EditorConfig.EditorConfigParser.<>c__DisplayClass0_0.<FindForDirectoryName>b__1(IFileInfo o) in /home/runner/work/csharpier/csharpier/Src/CSharpier.Cli/EditorConfig/EditorConfigParser.cs:line 56
at System.Linq.Enumerable.SelectListIterator`2.Fill(ReadOnlySpan`1 source, Span`1 destination, Func`2 func)
at System.Linq.Enumerable.SelectListIterator`2.ToArray()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.OrderedEnumerable`1.ToList()
at CSharpier.Cli.EditorConfig.EditorConfigParser.FindForDirectoryName(String directoryName, IFileSystem fileSystem, Boolean limitEditorConfigSearch, IgnoreFile ignoreFile) in /home/runner/work/csharpier/csharpier/Src/CSharpier.Cli/EditorConfig/EditorConfigParser.cs:line 53
at CSharpier.Cli.Options.OptionsProvider.Create(String directoryName, String configPath, IFileSystem fileSystem, ILogger logger, CancellationToken cancellationToken, Boolean limitEditorConfigSearch) in /home/runner/work/csharpier/csharpier/Src/CSharpier.Cli/Options/OptionsProvider.cs:line 56
Formatted 0 files in 1872ms.
The file that causes the exception is in a directory without any C# files, installed by a third-party JS module.
cat Frontend/scheduleboard/node_modules/worker-farm/.editorconfig
# This file is for unifying the coding style for different editors and IDEs
# editorconfig.org
root = true
[*]
end_of_line = lf
charset = utf-8
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 2
[*.js]
max_line_length = 80
View
The text was updated successfully, but these errors were encountered:
As a workaround, you can tell csharpier to ignore the bad editorconfig in the .csharpierignore file. I think this should be fairly straightforward to fix though.
Environments:
main
Steps to reproduce:
Have a broken
.editorconfig
in the file tree, run format.Expected behavior:
Not sure, my current best idea is to ignore broken
.editorconfig
files with a warning.In my case the file is installed by
npm
, so I cannot simply fix or remove it.Also, the current exception does not provide the broken config location, only the repo root folder name.
Actual behavior:
The file that causes the exception is in a directory without any C# files, installed by a third-party JS module.
The text was updated successfully, but these errors were encountered: