Look for .editorconfig in cwd and parent directories when readinf from STDIN and no explicit config dir given on command line

This commit is contained in:
kas-luthor 2017-09-01 09:15:13 +02:00
parent aa93473702
commit 2645e9cc1f
1 changed files with 9 additions and 1 deletions

View File

@ -146,13 +146,21 @@ else
{
import std.file : getcwd;
auto cwdDummyPath = buildPath(getcwd(), "dummy.d");
Config config;
config.initializeWithDefaults();
if (explicitConfigDir != "")
{
config.merge(explicitConfig, buildPath(explicitConfigDir, "dummy.d"));
}
config.merge(optConfig, buildPath(getcwd(), "dummy.d"));
else
{
Config fileConfig = getConfigFor!Config(getcwd());
fileConfig.pattern = "*.d";
config.merge(fileConfig, cwdDummyPath);
}
config.merge(optConfig, cwdDummyPath);
if (!config.isValid())
return 1;
ubyte[4096] inputBuffer;