Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
jssblck committed Dec 13, 2023
1 parent 93b57ba commit dca9a22
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
6 changes: 3 additions & 3 deletions src/App/Fossa/VSI/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
34 changes: 17 additions & 17 deletions test/App/Fossa/VSI/TypesSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ invalidLocatorInference =

expectedEmptyLocatorInference :: VsiExportedInferencesBody
expectedEmptyLocatorInference =
VsiExportedInferencesBody
$ Map.fromList
VsiExportedInferencesBody $
Map.fromList
[
( VsiFilePath "/foo/bar.h"
, VsiInference Nothing
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit dca9a22

Please sign in to comment.