Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compatibility with hnix≥0.13.0 #51

Merged
merged 1 commit into from
Jun 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions main/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ listDirRecursive path = resolveDir' path >>= readDir

parseFiles = S.mapMaybeM $ (\path ->
parseNixFileLoc path >>= \case
Success parse -> do
Right parse -> do
pure $ Just parse
Failure why -> do
Left why -> do
liftIO $ whenNormal $ log $ "Failure when parsing:\n" <> pShow why
pure Nothing)

Expand Down
2 changes: 1 addition & 1 deletion nix-linter.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ library

build-depends:
base >=4.9,
hnix >=0.8 && < 0.11,
hnix >=0.8 && < 0.14,
data-fix,
fixplate >= 0.1.7,
cmdargs >= 0.10,
Expand Down
4 changes: 2 additions & 2 deletions tests/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ case_examples_match = do
let check = checkCategories $ Set.toList category

parsed <- parseNixFileLoc (exampleDir </> example) >>= \case
Success x -> pure x
Failure err -> assertFailure (show err)
Right x -> pure x
Left err -> assertFailure (show err)

let offenses = Set.fromList $ offense <$> check parsed
assertEqual strippedName offenses category
Expand Down