packages feed

git-fmt 0.3.1.0 → 0.3.1.1

raw patch · 3 files changed

+8/−7 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

app/Main.hs view
@@ -86,9 +86,12 @@  handle :: (MonadIO m, MonadLogger m, MonadMask m, MonadParallel m, MonadReader Config m) => Options -> m () handle options = do-    filePaths <- runPanic $ if null (argPaths options)+    rootDir         <- liftIO getCurrentDirectory+    filePaths       <- runPanic $ if null (argPaths options)         then initialFilePaths options         else liftM2 intersect (initialFilePaths options) (providedFilePaths options)+    absFilePaths    <- forM filePaths $ \filePath -> ifM (liftIO $ doesFileExist filePath)+        (liftIO $ canonicalizePath filePath) (return filePath)      numThreads <- liftIO getNumCapabilities >>= \numCapabilities ->         return $ fromMaybe numCapabilities (optThreads options)@@ -96,7 +99,7 @@     (output, input) <- liftIO $ spawn unbounded      withSystemTempDirectory "git-fmt" $ \tmpDir -> do-        runEffect $ each (map (\filePath -> omnifmt filePath (tmpDir </> filePath)) filePaths) >-> toOutput output+        runEffect $ each (map (\filePath -> omnifmt (makeRelative rootDir filePath) (tmpDir </> dropDrive filePath)) absFilePaths) >-> toOutput output          liftIO performGC 
git-fmt.cabal view
@@ -1,5 +1,5 @@ name:           git-fmt-version:        0.3.1.0+version:        0.3.1.1  author:         Henry J. Wylde maintainer:     public@hjwylde.com
src/Omnifmt/Config.hs view
@@ -66,12 +66,10 @@     Right config    -> return $ Just config  -- | Finds the nearest config file by searching from the given directory upwards.------   TODO (hjw): fix the bug where it won't search the root directory. nearestConfigFile :: MonadIO m => FilePath -> m (Maybe FilePath)-nearestConfigFile dir = findM (liftIO . doesFileExist) $ map (</> defaultFileName) parents+nearestConfigFile dir = liftIO (canonicalizePath dir) >>= \dir' -> findM (liftIO . doesFileExist) $ map (</> defaultFileName) (parents dir')     where-        parents = takeWhile (\dir -> dir /= takeDrive dir) (iterate takeDirectory dir)+        parents = reverse . scanl1 combine . splitDirectories  -- | The file name of the default config, '.omnifmt.yaml'. defaultFileName :: FilePath