Skip to content

Soulomoon/refactor session #126

Soulomoon/refactor session

Soulomoon/refactor session #126

Triggered via pull request May 22, 2024 03:55
Status Success
Total duration 52s
Artifacts

hlint.yml

on: pull_request
Hlint check run
42s
Hlint check run
Fit to window
Zoom out
Zoom in

Annotations

15 warnings
Hlint check run
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v3, rwe/actions-hlint-setup@v1, rwe/actions-hlint-run@v2. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
Hlint check run
The following actions uses node12 which is deprecated and will be forced to run on node16: rwe/actions-hlint-setup@v1, rwe/actions-hlint-run@v2. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
Hlint check run: exe/Wrapper.hs#L1
Warning in module Main: Use module export list ▫︎ Found: "module Main where" ▫︎ Perhaps: "module Main (\n module Main\n ) where" ▫︎ Note: an explicit list is usually better
Hlint check run: ghcide/session-loader/Development/IDE/Session.hs#L118
Suggestion in module Development.IDE.Session: Redundant as ▫︎ Found: "import qualified UnliftIO as UnliftIO" ▫︎ Perhaps: "import qualified UnliftIO"
Hlint check run: ghcide/session-loader/Development/IDE/Session.hs#L507
Suggestion in loadSessionWithOptions in module Development.IDE.Session: Redundant $ ▫︎ Found: "return\n $ (cradleLocRule <> hieYamlRule, \n do clientConfig <- getClientConfigAction\n ShakeExtras {restartShakeSession, ideNc, knownTargetsVar,\n lspEnv} <- getShakeExtras\n IdeOptions {optTesting = IdeTesting optTesting,\n optCheckProject = getCheckProject, optExtensions} <- getIdeOptions\n let extendKnownTargets newTargets\n = do knownTargets <- concatForM newTargets\n $ \\ TargetDetails {..}\n -> case targetTarget of\n TargetFile f\n -> do fs <- filterM\n (IO.doesFileExist\n . fromNormalizedFilePath)\n targetLocations\n pure\n $ map\n (\\ fp\n -> (TargetFile fp, Set.singleton fp))\n (nubOrd (f : fs))\n TargetModule _\n -> do found <- filterM\n (IO.doesFileExist\n . fromNormalizedFilePath)\n targetLocations\n return [(targetTarget, Set.fromList found)]\n hasUpdate <- atomically\n $ do known <- readTVar knownTargetsVar\n let known'\n = flip mapHashed known\n $ \\ k\n -> HM.unionWith (<>) k\n $ HM.fromList knownTargets\n hasUpdate\n = if known /= known' then\n Just (unhashed known')\n else\n Nothing\n writeTVar knownTargetsVar known'\n pure hasUpdate\n for_ hasUpdate\n $ \\ x -> logWith recorder Debug $ LogKnownFilesUpdated x\n return $ toNoFileKey GetKnownTargets\n let packageSetup ::\n (Maybe FilePath, NormalizedFilePath, ComponentOptions, FilePath)\n -> IO ([ComponentInfo], [ComponentInfo])\n packageSetup (hieYaml, cfp, opts, libDir)\n = do hscEnv <- emptyHscEnv ideNc libDir\n newTargetDfs <- evalGhcEnv hscEnv\n $ setOptions cfp opts (hsc_dflags hscEnv) rootDir\n let deps = componentDependencies opts ++ maybeToList hieYaml\n dep_info <- getDependencyInfo deps\n modifyVar hscEnvs\n $ \\ m\n -> do let oldDeps = Map.lookup hieYaml m\n let new_deps\n = fmap\n (\\ (df, targets)\n -> RawComponentInfo\n (homeUnitId_ df) df targets cfp opts dep_info)\n newTargetDfs\n all_deps = new_deps `NE.appendList` fromMaybe [] oldDeps\n _inplace = map rawComponentUnitId $ NE.toList all_deps\n all_deps' <- forM all_deps\n $ \\ RawComponentInfo {..}\n -> do let (df2, uids)\n = _removeInplacePackages\n fakeUid _inplace\n rawComponentDynFlags\n let prefix = show rawComponentUnitId\n let hscComponents = sort $ map show uids\n cacheDirOpts\n = hscComponents\n ++ componentOptions opts\n cacheDirs <- liftIO\n $ getCacheDirs\n prefix cacheDirOpts\n processed_df <- setCacheDirs\n recorder cacheDirs df2\n pure\n $ ComponentInfo\n {componentUnitId = rawComponentUnitId,\n componentDynFlags = processed_df,\n componentInternalUnits = uids,\n componentTargets = rawComponentTargets,\n componentFP = rawComponentFP,\n componentCOptions = rawComponentCOptions,\n componentDependencyInfo = rawComponentDependencyInfo}\n let (new, old) = NE.splitAt (NE.length new_deps) all_deps'\n pure (Map.insert hieYaml (NE.toList all_deps) m, (new, old))\n let session ::\n (Maybe FilePath, NormalizedFilePath, ComponentOptions, FilePath)\n -> Action (IdeResult HscEnvEq, [FilePath])\n session args@(hieYaml, _cfp, _opts, _libDir)\n = do (new_deps, old_deps) <- liftIO $ packageSetup args\n hscEnv <- liftIO $ emptyHscEnv ideNc _libDir\n let new_cache\n = newComponentCache recorder optExtensions hieYaml _cfp hscEnv\n all_target_details <- liftIO $ new_cache old_deps new_deps rootDir\n this_dep_info <- liftIO $ getDependencyInfo $ maybeToList hieYaml\n let (all_targets, this_flags_map, this_options)\n = case HM.lookup _cfp flags_map' of\n Just this -> (all_targets', flags_map', this)\n Nothing\n -> (this_target_details : all_targets', \n HM.insert _cfp this_flags flags_map', this_flags)\n where\n all_targets' = concat all_target_details\n flags_map' = HM.fromList (concatMap toFlagsMap all_targets')\n this_target_details\n = TargetDetails\n (TargetFile _cfp) this_error_env this_dep_info [_cfp]\n this_flags = (this_error_env, this_dep_info)\n this_error_env = ([this_error], Nothing)\n this_error\n = ideErrorWithSource\n (Just \"cradle\") (Just DiagnosticSeverity_Error) _cfp\n $ T.unlines\n [\"No cradle target found. Is this file listed in the targets of your cradle?\",\n \"If you are usin
Hlint check run: ghcide/session-loader/Development/IDE/Session.hs#L655
Suggestion in loadSessionWithOptions in module Development.IDE.Session: Redundant $ ▫︎ Found: "liftIO $ getCheckProject" ▫︎ Perhaps: "liftIO getCheckProject"
Hlint check run: ghcide/session-loader/Development/IDE/Session.hs#L711
Warning in loadSessionWithOptions in module Development.IDE.Session: Use atomicModifyIORef'_ ▫︎ Found: "atomicModifyIORef'\n cradle_files (\\ xs -> (fromNormalizedFilePath cfp : xs, ()))" ▫︎ Perhaps: "atomicModifyIORef'_ cradle_files ((:) (fromNormalizedFilePath cfp))"
Hlint check run: ghcide/session-loader/Development/IDE/Session/Diagnostics.hs#L1
Warning in module Development.IDE.Session.Diagnostics: Use module export list ▫︎ Found: "module Development.IDE.Session.Diagnostics where" ▫︎ Perhaps: "module Development.IDE.Session.Diagnostics (\n module Development.IDE.Session.Diagnostics\n ) where" ▫︎ Note: an explicit list is usually better
Hlint check run: ghcide/session-loader/Development/IDE/Session/Diagnostics.hs#L87
Warning in parseMultiCradleErr in module Development.IDE.Session.Diagnostics: Use drop1 ▫︎ Found: "drop 1" ▫︎ Perhaps: "drop1"
Hlint check run: ghcide/src/Development/IDE/Core/Compile.hs#L72
Warning in module Development.IDE.Core.Compile: Use fewer imports ▫︎ Found: "import Development.IDE.Core.FileStore ( resetInterfaceStore )\nimport Development.IDE.Core.FileStore ( shareFilePath )\n" ▫︎ Perhaps: "import Development.IDE.Core.FileStore\n ( resetInterfaceStore, shareFilePath )\n"
Hlint check run: ghcide/src/Development/IDE/Core/Rules.hs#L828
Suggestion in getModIfaceFromDiskRule in module Development.IDE.Core.Rules: Use fmap ▫︎ Found: "\\ fs -> map (snd . fromJust . hirCoreFp) <$> uses_ GetModIface fs" ▫︎ Perhaps: "fmap (map (snd . fromJust . hirCoreFp)) . uses_ GetModIface"
Hlint check run: ghcide/src/Development/IDE/Core/Rules.hs#L1110
Warning in getLinkableRule in module Development.IDE.Core.Rules: Use whenMaybe ▫︎ Found: "if exists then Just <$> getModTime obj_file else pure Nothing" ▫︎ Perhaps: "whenMaybe exists (getModTime obj_file)"
Hlint check run
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Hlint check run
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Hlint check run
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/