Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/Haskell/Template/Task.hs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
import Language.Haskell.Interpreter
(GhcError (..), InterpreterError (..), MonadInterpreter, OptionVal (..),
Extension(UnknownExtension), as, installedModulesInScope, interpret, languageExtensions, liftIO,
loadModules, reset, runInterpreter, set, setImports, setTopLevelModules, searchPath)

Check warning on line 67 in src/Haskell/Template/Task.hs

View workflow job for this annotation

GitHub Actions / build_and_test (ubuntu-latest, stack)

The import of ‘setTopLevelModules’

Check warning on line 67 in src/Haskell/Template/Task.hs

View workflow job for this annotation

GitHub Actions / build_and_test (ubuntu-latest, stack)

The import of ‘setTopLevelModules’

Check warning on line 67 in src/Haskell/Template/Task.hs

View workflow job for this annotation

GitHub Actions / build_and_test (ubuntu-latest, stack)

The import of ‘setTopLevelModules’

Check warning on line 67 in src/Haskell/Template/Task.hs

View workflow job for this annotation

GitHub Actions / build_and_test (ubuntu-latest, stack)

The import of ‘setTopLevelModules’
import Language.Haskell.Interpreter.Unsafe
(unsafeRunInterpreterWithArgs)
import Numeric.Natural (Natural)
Expand Down Expand Up @@ -609,7 +609,7 @@
checkResult reject ghcErrors how howMany $ const $ return ()
where
warnings = msum (selectWarnings config)
makeOpts xs = ("-w":) $ ("-Werror=" ++) <$> xs

Check notice on line 612 in src/Haskell/Template/Task.hs

View workflow job for this annotation

GitHub Actions / Check Spelling

Line matches candidate pattern (Compiler flags) ``(?:^|[\t ,"'`=(])-[DPWXYLlf](?=[A-Z]{2,}|[A-Z][a-z]|[a-z]{2,})`` (candidate-pattern)
ghcOpts = makeOpts warnings
howMany = runIdentity $ configGhcLimit config
extensions = extensionsOf config
Expand All @@ -624,7 +624,7 @@
-> String
-> m ()
matchTemplate reject config context exts template submission =
runMatchTestOn reject exts template submission $ \case

Check warning on line 627 in src/Haskell/Template/Task.hs

View workflow job for this annotation

GitHub Actions / build_and_test (ubuntu-latest, stack)

Pattern match(es) are non-exhaustive

Check warning on line 627 in src/Haskell/Template/Task.hs

View workflow job for this annotation

GitHub Actions / build_and_test (ubuntu-latest, stack)

Pattern match(es) are non-exhaustive
Fail loc -> mapM_ (rejectMatch rejectWithHint config context template submission) loc
where
rejectWithHint = rejectWithMessage reject rejectHint
Expand Down Expand Up @@ -743,9 +743,10 @@
reset -- Make sure nothing is available
set [installedModulesInScope := False]
set [searchPath := [dirname]]
-- All modules can be imported in source files
loadModules ("TestHarness" : modules)
setTopLevelModules modules
setImports ["Prelude", "Test.HUnit", "TestHarness"]
-- All export items from these modules are in scope for the interpreter evaluation
setImports $ ["Prelude", "Test.HUnit", "TestHarness"] ++ ["Test" | "Test" `elem` modules]
where
readExt input = fromMaybe (UnknownExtension input) $ readMaybe input

Expand Down Expand Up @@ -818,7 +819,7 @@
(return . (,rawModules))
eConfig
where
configJson:rawModules = splitModules False configAndModules

Check warning on line 822 in src/Haskell/Template/Task.hs

View workflow job for this annotation

GitHub Actions / build_and_test (ubuntu-latest, stack)

Pattern match(es) are non-exhaustive

Check warning on line 822 in src/Haskell/Template/Task.hs

View workflow job for this annotation

GitHub Actions / build_and_test (ubuntu-latest, stack)

Pattern match(es) are non-exhaustive
eConfig :: Either ParseException SolutionConfigOpt
eConfig = decodeEither' $ BS.pack configJson

Expand Down
Loading