File tree Expand file tree Collapse file tree 3 files changed +13
-8
lines changed
lib/Language/Haskell/Stylish Expand file tree Collapse file tree 3 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -95,9 +95,13 @@ following order:
9595 settings)
96963 . `. stylish- haskell. yaml` in the nearest ancestor directory (useful for
9797 per- project settings)
98- 4 . `. stylish- haskell. yaml` in your home directory (useful for user- wide
98+ 4 . `stylish- haskell/ config. yaml` in the platform’ s configuration directory
99+ (on Windows , it is % APPDATA % , elsewhere it defaults to `~/. config` and
100+ can be overridden by the `XDG_CONFIG_HOME ` environment variable;
101+ useful for user- wide settings)
102+ 5 . `. stylish- haskell. yaml` in your home directory (useful for user- wide
99103 settings)
100- 5 . The default settings.
104+ 6 . The default settings.
101105
102106Use `stylish- haskell -- defaults > .stylish-haskell.yaml` to dump a
103107well- documented default configuration to a file, this way you can get started
Original file line number Diff line number Diff line change @@ -73,12 +73,13 @@ defaultConfigFilePath = getDataFileName "data/stylish-haskell.yaml"
7373configFilePath :: Verbose -> Maybe FilePath -> IO FilePath
7474configFilePath _ (Just userSpecified) = return userSpecified
7575configFilePath verbose Nothing = do
76- current <- getCurrentDirectory
77- home <- getHomeDirectory
78- def <- defaultConfigFilePath
79- mbConfig <- search $
76+ current <- getCurrentDirectory
77+ configPath <- getXdgDirectory XdgConfig " stylish-haskell"
78+ home <- getHomeDirectory
79+ def <- defaultConfigFilePath
80+ mbConfig <- search $
8081 [d </> configFileName | d <- ancestors current] ++
81- [home </> configFileName, def]
82+ [configPath </> " config.yaml " , home </> configFileName, def]
8283
8384 case mbConfig of
8485 Just config -> return config
Original file line number Diff line number Diff line change @@ -125,7 +125,7 @@ Test-suite stylish-haskell-tests
125125 base >= 4.8 && < 5 ,
126126 bytestring >= 0.9 && < 0.11 ,
127127 containers >= 0.3 && < 0.6 ,
128- directory >= 1.1 && < 1.4 ,
128+ directory >= 1.2.3 && < 1.4 ,
129129 filepath >= 1.1 && < 1.5 ,
130130 haskell-src-exts >= 1.18 && < 1.21 ,
131131 mtl >= 2.0 && < 2.3 ,
You can’t perform that action at this time.
0 commit comments