From fbc68b2897c43b7bcd97c5b51e0eb160d1c3d4a8 Mon Sep 17 00:00:00 2001 From: Phil de Joux Date: Sun, 8 Dec 2024 15:27:14 -0500 Subject: [PATCH] Use literal text for layout --- .../Solver/Types/ProjectConfigPath.hs | 84 +++++++++---------- 1 file changed, 41 insertions(+), 43 deletions(-) diff --git a/cabal-install-solver/src/Distribution/Solver/Types/ProjectConfigPath.hs b/cabal-install-solver/src/Distribution/Solver/Types/ProjectConfigPath.hs index b98d493656c..bb1a81bc1b5 100644 --- a/cabal-install-solver/src/Distribution/Solver/Types/ProjectConfigPath.hs +++ b/cabal-install-solver/src/Distribution/Solver/Types/ProjectConfigPath.hs @@ -51,12 +51,12 @@ instance Binary ProjectConfigPath instance Structured ProjectConfigPath -- | Renders the path like this; --- @ --- D.config --- imported by: C.config --- imported by: B.config --- imported by: A.project --- @ +-- +-- >D.config +-- > imported by: C.config +-- > imported by: B.config +-- > imported by: A.project +-- -- >>> render . docProjectConfigPath $ ProjectConfigPath $ "D.config" :| ["C.config", "B.config", "A.project"] -- "D.config\n imported by: C.config\n imported by: B.config\n imported by: A.project" docProjectConfigPath :: ProjectConfigPath -> Doc @@ -66,19 +66,19 @@ docProjectConfigPath (ProjectConfigPath (p :| ps)) = vcat $ -- | Renders the paths as a list without showing which path imports another, -- like this; --- @ --- - cabal.project --- - project-cabal/constraints.config --- - project-cabal/ghc-latest.config --- - project-cabal/ghc-options.config --- - project-cabal/pkgs.config --- - project-cabal/pkgs/benchmarks.config --- - project-cabal/pkgs/buildinfo.config --- - project-cabal/pkgs/cabal.config --- - project-cabal/pkgs/install.config --- - project-cabal/pkgs/integration-tests.config --- - project-cabal/pkgs/tests.config --- @ +-- +-- >- cabal.project +-- >- project-cabal/constraints.config +-- >- project-cabal/ghc-latest.config +-- >- project-cabal/ghc-options.config +-- >- project-cabal/pkgs.config +-- >- project-cabal/pkgs/benchmarks.config +-- >- project-cabal/pkgs/buildinfo.config +-- >- project-cabal/pkgs/cabal.config +-- >- project-cabal/pkgs/install.config +-- >- project-cabal/pkgs/integration-tests.config +-- >- project-cabal/pkgs/tests.config +-- -- -- >>> :{ -- do @@ -161,32 +161,30 @@ makeRelativeConfigPath dir (ProjectConfigPath p) = -- instead of relative to the file it was imported from. -- -- It converts paths like this: --- @ --- └─ hops-0.project --- └─ hops/hops-1.config --- └─ ../hops-2.config --- └─ hops/hops-3.config --- └─ ../hops-4.config --- └─ hops/hops-5.config --- └─ ../hops-6.config --- └─ hops/hops-7.config --- └─ ../hops-8.config --- └─ hops/hops-9.config --- @ +-- +-- > hops-0.project +-- > └─ hops/hops-1.config +-- > └─ ../hops-2.config +-- > └─ hops/hops-3.config +-- > └─ ../hops-4.config +-- > └─ hops/hops-5.config +-- > └─ ../hops-6.config +-- > └─ hops/hops-7.config +-- > └─ ../hops-8.config +-- > └─ hops/hops-9.config -- -- Into paths like this: --- @ --- └─ hops-0.project --- └─ hops/hops-1.config --- └─ hops-2.config --- └─ hops/hops-3.config --- └─ hops-4.config --- └─ hops/hops-5.config --- └─ hops-6.config --- └─ hops/hops-7.config --- └─ hops-8.config --- └─ hops/hops-9.config --- @ +-- +-- > hops-0.project +-- > └─ hops/hops-1.config +-- > └─ hops-2.config +-- > └─ hops/hops-3.config +-- > └─ hops-4.config +-- > └─ hops/hops-5.config +-- > └─ hops-6.config +-- > └─ hops/hops-7.config +-- > └─ hops-8.config +-- > └─ hops/hops-9.config -- -- That way we have @hops-8.config@ instead of -- @./hops/../hops/../hops/../hops/../hops-8.config@.