From bbdf5ee8f7c47d1146243f2ab689727dbdfd16f8 Mon Sep 17 00:00:00 2001 From: Anton Sorokin Date: Fri, 11 Nov 2022 01:41:43 +0200 Subject: [PATCH] fixup! fixup! fixup! fixup! fixup! fixup! [#164] Add workflow for running Windows tests on CI --- exec/Main.hs | 3 ++- package.yaml | 2 +- src/Xrefcheck/Command.hs | 3 +-- src/Xrefcheck/System.hs | 2 +- tests/golden/helpers.bash | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/exec/Main.hs b/exec/Main.hs index f9b83cfc..532fb26e 100644 --- a/exec/Main.hs +++ b/exec/Main.hs @@ -9,13 +9,14 @@ import Universum import Data.ByteString qualified as BS import Main.Utf8 (withUtf8) +import System.IO.CodePage (withCP65001) import Xrefcheck.CLI (Command (..), getCommand) import Xrefcheck.Command (defaultAction) import Xrefcheck.Config (defConfigText) main :: IO () -main = withUtf8 $ do +main = withUtf8 $ withCP65001 $ do command <- getCommand case command of DefaultCommand options -> diff --git a/package.yaml b/package.yaml index dd59858e..bcb7da7a 100644 --- a/package.yaml +++ b/package.yaml @@ -113,7 +113,6 @@ library: - yaml - reflection - nyan-interpolation - - code-page executables: xrefcheck: @@ -131,6 +130,7 @@ executables: - bytestring - universum - with-utf8 + - code-page tests: xrefcheck-tests: diff --git a/src/Xrefcheck/Command.hs b/src/Xrefcheck/Command.hs index add06ba3..2ed868c6 100644 --- a/src/Xrefcheck/Command.hs +++ b/src/Xrefcheck/Command.hs @@ -15,7 +15,6 @@ import Fmt (build, fmt, fmtLn) import System.Console.Pretty (supportsPretty) import System.Directory (doesFileExist) import Text.Interpolation.Nyan -import System.IO.CodePage (withCP65001) import Xrefcheck.CLI (Options (..), addExclusionOptions, addNetworkingOptions, defaultConfigPaths) import Xrefcheck.Config @@ -48,7 +47,7 @@ findFirstExistingFile = \case if exists then pure (Just file) else findFirstExistingFile files defaultAction :: Options -> IO () -defaultAction Options{..} = withCP65001 $ do +defaultAction Options{..} = do coloringSupported <- supportsPretty give (if coloringSupported then oColorMode else WithoutColors) $ do config <- case oConfigPath of diff --git a/src/Xrefcheck/System.hs b/src/Xrefcheck/System.hs index 37b9fd58..20f340f6 100644 --- a/src/Xrefcheck/System.hs +++ b/src/Xrefcheck/System.hs @@ -22,8 +22,8 @@ import GHC.IO.Unsafe (unsafePerformIO) import System.Directory (canonicalizePath) import System.Environment (lookupEnv) import System.FilePath.Glob qualified as Glob -import Text.Interpolation.Nyan import System.FilePath.Posix (isRelative, ()) +import Text.Interpolation.Nyan import Xrefcheck.Util (normaliseWithNoTrailing) diff --git a/tests/golden/helpers.bash b/tests/golden/helpers.bash index 97740ce1..bc7994ca 100644 --- a/tests/golden/helpers.bash +++ b/tests/golden/helpers.bash @@ -67,6 +67,6 @@ assert_diff() { : "{output_file?}" diff $output_file $1 \ - --ignore-tab-expansion + --ignore-tab-expansion \ --strip-trailing-cr }