Skip to content

Commit 7f88e07

Browse files
ryanlinkclaude
andcommitted
[ANE-1322] Apply code quality fixes to Maven path filter test
- Change qualified import from T to Text for consistency - Apply fourmolu formatting corrections - Fix import ordering 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent f65d3f2 commit 7f88e07

1 file changed

Lines changed: 26 additions & 27 deletions

File tree

test/Maven/PathFilterSpec.hs

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ module Maven.PathFilterSpec (
77
import Control.Carrier.Reader (local)
88
import Control.Effect.Lift (sendIO)
99
import Data.Map.Strict qualified as Map
10-
import Data.Text qualified as T
10+
import Data.Text qualified as Text
1111
import Data.Text.IO qualified as TIO
1212
import Discovery.Filters (AllFilters (..), comboExclude)
1313
import Path (Abs, Dir, File, Path, mkRelDir, mkRelFile, (</>))
14-
import qualified Path
14+
import Path qualified
1515
import Path.IO (createDirIfMissing)
1616
import Strategy.Maven.Pom.Resolver (GlobalClosure (..), buildGlobalClosure)
17-
import Test.Effect (itWithTempDir', shouldBe', EffectStack)
17+
import Test.Effect (EffectStack, itWithTempDir', shouldBe')
1818
import Test.Hspec (Spec, describe)
1919

2020
spec :: Spec
@@ -26,7 +26,6 @@ spec =
2626
-- | Build a minimal on-disk Maven project with a parent POM located in an
2727
-- excluded '.m2' directory. The test asserts that the parent POM is not
2828
-- loaded when discovery filters exclude that directory.
29-
3029
testNoTraversal :: Path Abs Dir -> EffectStack ()
3130
testNoTraversal rootDir = do
3231
-- Paths -------------------------------------------------------------
@@ -41,31 +40,31 @@ testNoTraversal rootDir = do
4140
parentPomPath = parentDir </> $(mkRelFile "pom.xml")
4241

4342
-- File contents -----------------------------------------------------
44-
let rootPom :: T.Text
43+
let rootPom :: Text.Text
4544
rootPom =
46-
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" <>
47-
"<project xmlns=\"http://maven.apache.org/POM/4.0.0\">\n" <>
48-
" <modelVersion>4.0.0</modelVersion>\n" <>
49-
" <parent>\n" <>
50-
" <groupId>test</groupId>\n" <>
51-
" <artifactId>parent</artifactId>\n" <>
52-
" <version>1.0.0</version>\n" <>
53-
" <relativePath>.m2/repository/test/parent/pom.xml</relativePath>\n" <>
54-
" </parent>\n" <>
55-
" <groupId>test</groupId>\n" <>
56-
" <artifactId>child</artifactId>\n" <>
57-
" <version>1.0.0</version>\n" <>
58-
"</project>\n"
45+
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
46+
<> "<project xmlns=\"http://maven.apache.org/POM/4.0.0\">\n"
47+
<> " <modelVersion>4.0.0</modelVersion>\n"
48+
<> " <parent>\n"
49+
<> " <groupId>test</groupId>\n"
50+
<> " <artifactId>parent</artifactId>\n"
51+
<> " <version>1.0.0</version>\n"
52+
<> " <relativePath>.m2/repository/test/parent/pom.xml</relativePath>\n"
53+
<> " </parent>\n"
54+
<> " <groupId>test</groupId>\n"
55+
<> " <artifactId>child</artifactId>\n"
56+
<> " <version>1.0.0</version>\n"
57+
<> "</project>\n"
5958

60-
parentPom :: T.Text
59+
parentPom :: Text.Text
6160
parentPom =
62-
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" <>
63-
"<project xmlns=\"http://maven.apache.org/POM/4.0.0\">\n" <>
64-
" <modelVersion>4.0.0</modelVersion>\n" <>
65-
" <groupId>test</groupId>\n" <>
66-
" <artifactId>parent</artifactId>\n" <>
67-
" <version>1.0.0</version>\n" <>
68-
"</project>\n"
61+
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
62+
<> "<project xmlns=\"http://maven.apache.org/POM/4.0.0\">\n"
63+
<> " <modelVersion>4.0.0</modelVersion>\n"
64+
<> " <groupId>test</groupId>\n"
65+
<> " <artifactId>parent</artifactId>\n"
66+
<> " <version>1.0.0</version>\n"
67+
<> "</project>\n"
6968

7069
-- Create directories + write files ---------------------------------
7170
sendIO $ createDirIfMissing True (parentDir)
@@ -79,4 +78,4 @@ testNoTraversal rootDir = do
7978
GlobalClosure{globalPoms} <- local (const filters) $ buildGlobalClosure rootDir [rootPomPath]
8079

8180
-- We expect only the root POM to be present -------------------------
82-
Map.size globalPoms `shouldBe'` 1
81+
Map.size globalPoms `shouldBe'` 1

0 commit comments

Comments
 (0)