Skip to content

Commit 267430a

Browse files
authored
Merge pull request #6684 from commercialhaskell/reformat
Minor reformatting of signatures, for consistency
2 parents 33485f2 + 5c48a31 commit 267430a

26 files changed

+401
-306
lines changed

.stan.toml

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -43,24 +43,24 @@
4343
# Infinite: base/isSuffixOf
4444
# Usage of the 'isSuffixOf' function that hangs on infinite lists
4545
[[ignore]]
46-
id = "OBS-STAN-0102-luLR/n-525:30"
46+
id = "OBS-STAN-0102-luLR/n-527:30"
4747
# ✦ Category: #Infinite #List
4848
# ✦ File: src\Stack\New.hs
4949
#
50-
# 524
51-
# 525 ┃ let isPkgSpec f = ".cabal" `L.isSuffixOf` f || "package.yaml" `L.isSuffixOf` f
52-
# 526 ┃ ^^^^^^^^^^^^^^
50+
# 526
51+
# 527 ┃ let isPkgSpec f = ".cabal" `L.isSuffixOf` f || "package.yaml" `L.isSuffixOf` f
52+
# 528 ┃ ^^^^^^^^^^^^^^
5353

5454
# Infinite: base/isSuffixOf
5555
# Usage of the 'isSuffixOf' function that hangs on infinite lists
5656
[[ignore]]
57-
id = "OBS-STAN-0102-luLR/n-525:65"
57+
id = "OBS-STAN-0102-luLR/n-527:65"
5858
# ✦ Category: #Infinite #List
5959
# ✦ File: src\Stack\New.hs
6060
#
61-
# 524
62-
# 525 ┃ let isPkgSpec f = ".cabal" `L.isSuffixOf` f || "package.yaml" `L.isSuffixOf` f
63-
# 526 ┃ ^^^^^^^^^^^^^^
61+
# 526
62+
# 527 ┃ let isPkgSpec f = ".cabal" `L.isSuffixOf` f || "package.yaml" `L.isSuffixOf` f
63+
# 528 ┃ ^^^^^^^^^^^^^^
6464

6565
# Infinite: base/length
6666
# Usage of the 'length' function that hangs on infinite lists
@@ -72,25 +72,25 @@
7272

7373
# Anti-pattern: Data.ByteString.Char8.pack
7474
[[ignore]]
75-
id = "OBS-STAN-0203-erw24B-1039:3"
75+
id = "OBS-STAN-0203-erw24B-1053:3"
7676
# ✦ Description: Usage of 'pack' function that doesn't handle Unicode characters
7777
# ✦ Category: #AntiPattern
7878
# ✦ File: src\Stack\Build\ExecuteEnv.hs
7979
#
80-
# 1038
81-
# 1039 ┃ S8.pack . formatTime defaultTimeLocale "%Y-%m-%dT%H:%M:%S%6Q"
82-
# 1040 ┃ ^^^^^^^
80+
# 1052
81+
# 1053 ┃ S8.pack . formatTime defaultTimeLocale "%Y-%m-%dT%H:%M:%S%6Q"
82+
# 1054 ┃ ^^^^^^^
8383

8484
# Anti-pattern: Data.ByteString.Char8.pack
8585
[[ignore]]
86-
id = "OBS-STAN-0203-tuE+RG-236:24"
86+
id = "OBS-STAN-0203-tuE+RG-242:24"
8787
# ✦ Description: Usage of 'pack' function that doesn't handle Unicode characters
8888
# ✦ Category: #AntiPattern
8989
# ✦ File: src\Stack\Build\ExecutePackage.hs
9090
#
91-
# 235
92-
# 236 ┃ newConfigFileRoot <- S8.pack . toFilePath <$> view configFileRootL
93-
# 237 ┃ ^^^^^^^
91+
# 241
92+
# 242 ┃ newConfigFileRoot <- S8.pack . toFilePath <$> view configFileRootL
93+
# 243 ┃ ^^^^^^^
9494

9595
# Anti-pattern: Data.ByteString.Char8.pack
9696
[[ignore]]
@@ -177,16 +177,16 @@
177177

178178
# Anti-pattern: unsafe functions
179179
[[ignore]]
180-
id = "OBS-STAN-0212-5rtOmw-460:33"
180+
id = "OBS-STAN-0212-5rtOmw-461:33"
181181
# ✦ Description: Usage of unsafe functions breaks referential transparency
182182
# ✦ Category: #Unsafe #AntiPattern
183183
# ✦ File: src\Stack\Constants.hs
184184
#
185-
# 459
186-
# 460 ┃ setupGhciShimCode = byteString $(do
187-
# 461 ┃ path <- makeRelativeToProject "src/setup-shim/StackSetupShim.hs"
188-
# 462 ┃ embedFile path)
189-
# 463
185+
# 460
186+
# 461 ┃ setupGhciShimCode = byteString $(do
187+
# 462 ┃ path <- makeRelativeToProject "src/setup-shim/StackSetupShim.hs"
188+
# 463 ┃ embedFile path)
189+
# 464
190190

191191
# Anti-pattern: unsafe functions
192192
[[ignore]]

src/GHC/Utils/GhcPkg/Main/Compat.hs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -554,13 +554,14 @@ unregisterPackages globalDb pkgargs pkgDb = do
554554
where
555555
-- Update a list of 'packages by package database' for a package. Assumes that
556556
-- a package to be unregistered is in no more than one database.
557-
getPkgsByPkgDBs :: [(PackageDB GhcPkg.DbReadWrite, [UnitId])]
558-
-- ^ List of considered 'packages by package database'
559-
-> [(PackageDB GhcPkg.DbReadWrite, [UnitId])]
560-
-- ^ List of to be considered 'packages by package database'
561-
-> PackageArg
562-
-- Package to update
563-
-> RIO env [(PackageDB GhcPkg.DbReadWrite, [UnitId])]
557+
getPkgsByPkgDBs ::
558+
[(PackageDB GhcPkg.DbReadWrite, [UnitId])]
559+
-- ^ List of considered 'packages by package database'
560+
-> [(PackageDB GhcPkg.DbReadWrite, [UnitId])]
561+
-- ^ List of to be considered 'packages by package database'
562+
-> PackageArg
563+
-- Package to update
564+
-> RIO env [(PackageDB GhcPkg.DbReadWrite, [UnitId])]
564565
-- No more 'packages by package database' to consider? We need to try to get
565566
-- another package database.
566567
getPkgsByPkgDBs pkgsByPkgDBs [] pkgarg =

src/Network/HTTP/StackClient.hs

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -153,19 +153,24 @@ setGitHubHeaders = setRequestHeader "Accept" ["application/vnd.github.v3+json"]
153153
-- appropriate destination.
154154
--
155155
-- Throws an exception if things go wrong
156-
download :: HasTerm env
157-
=> Request
158-
-> Path Abs File -- ^ destination
159-
-> RIO env Bool -- ^ Was a downloaded performed (True) or did the file already exist (False)?
156+
download ::
157+
HasTerm env
158+
=> Request
159+
-> Path Abs File
160+
-- ^ destination
161+
-> RIO env Bool
162+
-- ^ Was a downloaded performed (True) or did the file already exist
163+
-- (False)?
160164
download req = Download.download (setUserAgent req)
161165

162166
-- | Same as 'download', but will download a file a second time if it is already present.
163167
--
164168
-- Returns 'True' if the file was downloaded, 'False' otherwise
165-
redownload :: HasTerm env
166-
=> Request
167-
-> Path Abs File -- ^ destination
168-
-> RIO env Bool
169+
redownload ::
170+
HasTerm env
171+
=> Request
172+
-> Path Abs File -- ^ destination
173+
-> RIO env Bool
169174
redownload req = Download.redownload (setUserAgent req)
170175

171176
-- | Copied and extended version of Network.HTTP.Download.download.

src/Path/Find.hs

Lines changed: 33 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -19,33 +19,36 @@ import System.PosixCompat.Files
1919
( getSymbolicLinkStatus, isSymbolicLink )
2020

2121
-- | Find the location of a file matching the given predicate.
22-
findFileUp :: (MonadIO m, MonadThrow m)
23-
=> Path Abs Dir -- ^ Start here.
24-
-> (Path Abs File -> Bool) -- ^ Predicate to match the file.
25-
-> Maybe (Path Abs Dir) -- ^ Do not ascend above this directory.
26-
-> m (Maybe (Path Abs File)) -- ^ Absolute file path.
22+
findFileUp ::
23+
(MonadIO m, MonadThrow m)
24+
=> Path Abs Dir -- ^ Start here.
25+
-> (Path Abs File -> Bool) -- ^ Predicate to match the file.
26+
-> Maybe (Path Abs Dir) -- ^ Do not ascend above this directory.
27+
-> m (Maybe (Path Abs File)) -- ^ Absolute file path.
2728
findFileUp = findPathUp snd
2829

2930
-- | Find the location of a directory matching the given predicate.
30-
findDirUp :: (MonadIO m,MonadThrow m)
31-
=> Path Abs Dir -- ^ Start here.
32-
-> (Path Abs Dir -> Bool) -- ^ Predicate to match the directory.
33-
-> Maybe (Path Abs Dir) -- ^ Do not ascend above this directory.
34-
-> m (Maybe (Path Abs Dir)) -- ^ Absolute directory path.
31+
findDirUp ::
32+
(MonadIO m,MonadThrow m)
33+
=> Path Abs Dir -- ^ Start here.
34+
-> (Path Abs Dir -> Bool) -- ^ Predicate to match the directory.
35+
-> Maybe (Path Abs Dir) -- ^ Do not ascend above this directory.
36+
-> m (Maybe (Path Abs Dir)) -- ^ Absolute directory path.
3537
findDirUp = findPathUp fst
3638

3739
-- | Find the location of a path matching the given predicate.
38-
findPathUp :: (MonadIO m,MonadThrow m)
39-
=> (([Path Abs Dir],[Path Abs File]) -> [Path Abs t])
40-
-- ^ Choose path type from pair.
41-
-> Path Abs Dir
42-
-- ^ Start here.
43-
-> (Path Abs t -> Bool)
44-
-- ^ Predicate to match the path.
45-
-> Maybe (Path Abs Dir)
46-
-- ^ Do not ascend above this directory.
47-
-> m (Maybe (Path Abs t))
48-
-- ^ Absolute path.
40+
findPathUp ::
41+
(MonadIO m,MonadThrow m)
42+
=> (([Path Abs Dir],[Path Abs File]) -> [Path Abs t])
43+
-- ^ Choose path type from pair.
44+
-> Path Abs Dir
45+
-- ^ Start here.
46+
-> (Path Abs t -> Bool)
47+
-- ^ Predicate to match the path.
48+
-> Maybe (Path Abs Dir)
49+
-- ^ Do not ascend above this directory.
50+
-> m (Maybe (Path Abs t))
51+
-- ^ Absolute path.
4952
findPathUp pathType dir p upperBound = do
5053
entries <- listDir dir
5154
case L.find p (pathType entries) of
@@ -61,14 +64,15 @@ findPathUp pathType dir p upperBound = do
6164
--
6265
-- TODO: write one of these that traverses symbolic links but
6366
-- efficiently ignores loops.
64-
findFiles :: Path Abs Dir
65-
-- ^ Root directory to begin with.
66-
-> (Path Abs File -> Bool)
67-
-- ^ Predicate to match files.
68-
-> (Path Abs Dir -> Bool)
69-
-- ^ Predicate for which directories to traverse.
70-
-> IO [Path Abs File]
71-
-- ^ List of matching files.
67+
findFiles ::
68+
Path Abs Dir
69+
-- ^ Root directory to begin with.
70+
-> (Path Abs File -> Bool)
71+
-- ^ Predicate to match files.
72+
-> (Path Abs Dir -> Bool)
73+
-- ^ Predicate for which directories to traverse.
74+
-> IO [Path Abs File]
75+
-- ^ List of matching files.
7276
findFiles dir p traversep = do
7377
(dirs,files) <- catchJust (\ e -> if isPermissionError e
7478
then Just ()

0 commit comments

Comments
 (0)