From dca9a22382febccd72e426b4b3f8af18d09725e3 Mon Sep 17 00:00:00 2001 From: Jessica Black Date: Wed, 13 Dec 2023 12:46:45 -0800 Subject: [PATCH] Fix formatting --- src/App/Fossa/VSI/Types.hs | 6 +++--- test/App/Fossa/VSI/TypesSpec.hs | 34 ++++++++++++++++----------------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/App/Fossa/VSI/Types.hs b/src/App/Fossa/VSI/Types.hs index 66fa98a34f..9649793f81 100644 --- a/src/App/Fossa/VSI/Types.hs +++ b/src/App/Fossa/VSI/Types.hs @@ -78,11 +78,11 @@ instance FromJSON Locator where parseJSON = withObject "Locator" $ \obj -> do Locator <$> obj - .: "fetcher" + .: "fetcher" <*> obj - .: "package" + .: "package" <*> obj - .: "revision" + .: "revision" parseLocator :: (ToText a) => a -> Either LocatorParseError Locator parseLocator = validateLocator . Srclib.parseLocator . toText diff --git a/test/App/Fossa/VSI/TypesSpec.hs b/test/App/Fossa/VSI/TypesSpec.hs index e1feb54496..8fe0148ec3 100644 --- a/test/App/Fossa/VSI/TypesSpec.hs +++ b/test/App/Fossa/VSI/TypesSpec.hs @@ -72,8 +72,8 @@ invalidLocatorInference = expectedEmptyLocatorInference :: VsiExportedInferencesBody expectedEmptyLocatorInference = - VsiExportedInferencesBody - $ Map.fromList + VsiExportedInferencesBody $ + Map.fromList [ ( VsiFilePath "/foo/bar.h" , VsiInference Nothing @@ -163,21 +163,21 @@ vsiTypesSpec = describe "VSI Types" $ do generateRulesSpec :: Spec generateRulesSpec = describe "generateRules" $ do - it "Generates a rule correctly" - $ generateRules expectedSingleInference - `shouldBe` singleRuleExpected - it "Reduces rules to common prefixes" - $ generateRules' commonPrefixInferences - `shouldBe` singleRuleExpected - it "Reports multiple rules for a project" - $ generateRules' multipleInferences - `shouldMatchList` multipleRulesExpected - it "Reports distinct locators for nested projects" - $ generateRules' nestedProjectInferences - `shouldMatchList` nestedProjectRulesExpected - it "Reports root rules correctly" - $ generateRules' rootRuleInferences - `shouldMatchList` rootRuleExpected + it "Generates a rule correctly" $ + generateRules expectedSingleInference + `shouldBe` singleRuleExpected + it "Reduces rules to common prefixes" $ + generateRules' commonPrefixInferences + `shouldBe` singleRuleExpected + it "Reports multiple rules for a project" $ + generateRules' multipleInferences + `shouldMatchList` multipleRulesExpected + it "Reports distinct locators for nested projects" $ + generateRules' nestedProjectInferences + `shouldMatchList` nestedProjectRulesExpected + it "Reports root rules correctly" $ + generateRules' rootRuleInferences + `shouldMatchList` rootRuleExpected where generateRules' :: [(VsiFilePath, VsiInference)] -> [VsiRule] generateRules' = generateRules . VsiExportedInferencesBody . Map.fromList