Skip to content

Optimise module to filename #7641

Optimise module to filename

Optimise module to filename #7641

Triggered via pull request September 21, 2025 11:59
Status Failure
Total duration 52s
Artifacts

hlint.yml

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

Annotations

3 errors and 13 warnings
Hlint check run
HLint failed with status: 1. Error (2), Warning (142), Suggestion (34)
Hlint check run: ghcide/src/Development/IDE/Core/Rules.hs#L654
Error in getModulesPathsRule in module Development.IDE.Core.Rules: Avoid restricted function ▫︎ Found: "head" ▫︎ Note: may break the code
Hlint check run: ghcide/src/Development/IDE/Core/Rules.hs#L635
Error in cacheVar in module Development.IDE.Core.Rules: Avoid restricted function ▫︎ Found: "unsafePerformIO" ▫︎ Note: may break the code
Hlint check run: ghcide/src/Development/IDE/Core/Rules.hs#L648
Suggestion in getModulesPathsRule in module Development.IDE.Core.Rules: Redundant bracket ▫︎ Found: "do let env = hscEnv env_eq\n let import_dirs\n = map (second homeUnitEnv_dflags) $ hugElts $ hsc_HUG env\n opt <- getIdeOptions\n let exts = (optExtensions opt)\n let acceptedExtensions\n = concatMap (\\ x -> ['.' : x, '.' : x <> \"-boot\"]) exts\n (unzip -> (a, b)) <- flip mapM import_dirs\n $ \\ (u, dyn)\n -> do (unzip -> (a, b)) <- flip mapM (importPaths dyn)\n $ \\ dir'\n -> do let dir\n = dropTrailingPathSeparator\n dir'\n let predicate path\n = pure\n (path == dir\n ||\n isUpper\n (head\n (takeFileName\n path)))\n let dir_number_directories\n = length\n (splitDirectories\n dir)\n let toModule file\n = mkModuleName\n (intercalate \".\"\n $ drop\n dir_number_directories\n (splitDirectories\n (dropExtension\n file)))\n modules <- (fmap\n (\\ path\n -> (toModule\n path, \n toNormalizedFilePath'\n path))\n . filter\n (\\ y\n -> takeExtension\n y\n `elem`\n acceptedExtensions)\n <$>\n liftIO\n (listFilesInside\n predicate\n dir))\n `catch`\n (\\ (_ :: IOException)\n -> pure [])\n let isSourceModule (_, path)\n = \"-boot\"\n `isSuffixOf`\n fromNormalizedFilePath\n path\n let (sourceModules,\n notSourceModules)\n = partition\n isSourceModule\n modules\n pure\n $ (Map.fromList\n notSourceModules, \n Map.fromList\n sourceModules)\n pure (fmap (u,) $ mconcat a, fmap (u,) $ mconcat b)\n let res = (mconcat a, mconcat b)\n liftIO\n $ atomically\n $ modifyTVar' cacheVar (Map.insert (envUnique env_eq) res)\n pure (mempty, ([], Just $ (mconcat a, mconcat b)))" ▫︎ Perhaps: "do let env = hscEnv env_eq\n let import_dirs\n = map (second homeUnitEnv_dflags) $ hugElts $ hsc_HUG env\n opt <- getIdeOptions\n let exts = optExtensions opt\n let acceptedExtensions\n = concatMap (\\ x -> ['.' : x, '.' : x <> \"-boot\"]) exts\n (unzip -> (a, b)) <- flip mapM import_dirs\n $ \\ (u, dyn)\n -> do (unzip -> (a, b)) <- flip mapM (importPaths dyn)\n $ \\ dir'\n -> do let dir\n = dropTrailingPathSeparator\n dir'\n let predicate path\n = pure\n (path == dir\n ||\n isUpper\n (head\n (takeFileName\n path)))\n let dir_number_directories\n = length\n (splitDirectories\n dir)\n let toModule file\n = mkModuleName\n (intercalate \".\"\n $ drop\n dir_number_directories\n (splitDirectories\n (dropExtension\n file)))\n modules <- (fmap\n (\\ path\n -> (toModule\n path, \n toNormalizedFilePath'\n path))\n . filter\n (\\ y\n -> takeExtension\n y\n `elem`\n acceptedExtensions)\n <$>\n liftIO\n (listFilesInside\n predicate\n dir))\n `catch`\n (\\ (_ :: IOException)\n -> pure [])\n let isSourceModule (_, path)\n = \"-boot\"\n `isSuffixOf`\n fromNormalizedFilePath\n path\n let (sourceModules,\n notSourceModules)\n = partition\n isSourceModule\n modules\n pure\n $ (Map.fromList\n notSourceModules, \n Map.fromList\n sourceModules)\n pure (fmap (u,) $ mconcat a, fmap (u,) $ mconcat b)\n let res = (mconcat a, mconcat b)\n liftIO\n $ atomically\n $ modifyTVar' cacheVar (Map.insert (envUnique env_eq) res)\n pure (mempty, ([], Just $ (mconcat a, mconcat b)))"
Hlint check run: ghcide/src/Development/IDE/Core/PluginUtils.hs#L219
Warning in activeDiagnosticsInRangeMT in module Development.IDE.Core.PluginUtils: Redundant lambda ▫︎ Found: "diagRangeOverlaps\n = \\ fileDiag\n -> rangesOverlap range (fileDiag ^. fdLspDiagnosticL . LSP.range)" ▫︎ Perhaps: "diagRangeOverlaps fileDiag\n = rangesOverlap range (fileDiag ^. fdLspDiagnosticL . LSP.range)"
Hlint check run: ghcide/src/Development/IDE/Core/Compile.hs#L1108
Suggestion in getModSummaryFromImports in module Development.IDE.Core.Compile: Redundant bracket ▫︎ Found: "((ideclPkgQual i), reLoc $ ideclName i)" ▫︎ Perhaps: "(ideclPkgQual i, reLoc $ ideclName i)"
Hlint check run: ghcide/src/Development/IDE/Core/Compile.hs#L828
Suggestion in generateHieAsts in module Development.IDE.Core.Compile: Redundant $ ▫︎ Found: "Just $ hie_asts" ▫︎ Perhaps: "Just hie_asts"
Hlint check run: ghcide/src/Development/IDE/Core/Compile.hs#L73
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/session-loader/Development/IDE/Session/Diagnostics.hs#L92
Warning in parseMultiCradleErr in module Development.IDE.Session.Diagnostics: Use drop1 ▫︎ Found: "drop 1" ▫︎ Perhaps: "drop1"
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.hs#L899
Suggestion in newComponentCache in module Development.IDE.Session: Redundant bracket ▫︎ Found: "(homeUnitId_ (componentDynFlags ci)) `OS.member` bad_units" ▫︎ Perhaps: "homeUnitId_ (componentDynFlags ci) `OS.member` bad_units"
Hlint check run: ghcide/session-loader/Development/IDE/Session.hs#L632
Warning in loadSessionWithOptions in module Development.IDE.Session: Use atomicModifyIORef'_ ▫︎ Found: "atomicModifyIORef' cradle_files (\\ xs -> (cfp : xs, ()))" ▫︎ Perhaps: "atomicModifyIORef'_ cradle_files ((:) cfp)"
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
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/