Skip to content

Commit

Permalink
Some self review
Browse files Browse the repository at this point in the history
  • Loading branch information
belav committed Jul 14, 2023
1 parent df793ca commit e942cbf
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
1 change: 0 additions & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<PackageVersion Include="BenchmarkDotNet.Annotations" Version="0.13.5" />
<PackageVersion Include="CliWrap" Version="3.3.3" />
<PackageVersion Include="DiffEngine" Version="6.5.7" />
<PackageVersion Include="editorconfig" Version="0.14.0" />
<PackageVersion Include="FluentAssertions" Version="5.10.3" />
<PackageVersion Include="Glob" Version="1.1.9" />
<PackageVersion Include="Ignore" Version="0.1.48" />
Expand Down
1 change: 1 addition & 0 deletions Src/CSharpier.Cli/CSharpier.Cli.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<PackAsTool>true</PackAsTool>
<AssemblyOriginatorKeyFile>../../Nuget/csharpier.snk</AssemblyOriginatorKeyFile>
<SignAssembly>True</SignAssembly>
<!-- TODO 1 why is this signed again? Glob is not so this causes headaches-->
<PublicKey>002400000480000094000000060200000024000052534131000400000100010049d266ea1aeae09c0abfce28b8728314d4e4807126ee8bc56155a7ddc765997ed3522908b469ae133fc49ef0bfa957df36082c1c2e0ec8cdc05a4ca4dbd4e1bea6c17fc1008555e15af13a8fc871a04ffc38f5e60e6203bfaf01d16a2a283b90572ade79135801c1675bf38b7a5a60ec8353069796eb53a26ffdddc9ee1273be</PublicKey>
</PropertyGroup>
<ItemGroup>
Expand Down
4 changes: 3 additions & 1 deletion Src/CSharpier.Cli/EditorConfig/EditorConfigParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ namespace CSharpier.Cli.EditorConfig;

internal static class EditorConfigParser
{
public static List<EditorConfigSections> GetAllForDirectory(
/// <summary>Finds all configs above the given directory as well as within the subtree of this directory</summary>
public static List<EditorConfigSections> FindForDirectoryName(
string directoryName,
IFileSystem fileSystem
)
{
// TODO 1 this may not actually find things above the current directory
if (directoryName is "")
{
return new List<EditorConfigSections>();
Expand Down
3 changes: 2 additions & 1 deletion Src/CSharpier.Cli/Options/ConfigurationFileOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ ConfigurationFileOptions configurationFileOptions
};
}

internal static List<CSharpierConfigData> FindForDirectory2(
/// <summary>Finds all configs above the given directory as well as within the subtree of this directory</summary>
internal static List<CSharpierConfigData> FindForDirectoryName(
string directoryName,
IFileSystem fileSystem,
ILogger logger
Expand Down
7 changes: 5 additions & 2 deletions Src/CSharpier.Cli/Options/OptionsProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,13 @@ CancellationToken cancellationToken
: null;

var csharpierConfigs = configPath is null
? ConfigurationFileOptions.FindForDirectory2(directoryName, fileSystem, logger)
? ConfigurationFileOptions.FindForDirectoryName(directoryName, fileSystem, logger)
: Array.Empty<CSharpierConfigData>().ToList();

var editorConfigSections = EditorConfigParser.GetAllForDirectory(directoryName, fileSystem);
var editorConfigSections = EditorConfigParser.FindForDirectoryName(
directoryName,
fileSystem
);
var ignoreFile = await IgnoreFile.Create(directoryName, fileSystem, cancellationToken);

return new OptionsProvider(
Expand Down

0 comments on commit e942cbf

Please sign in to comment.