From 260b7b83b0ec396bb880038f4c93f977af0056c5 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Tue, 16 Dec 2025 14:14:41 -0500 Subject: Fix hlint errors in Deploy modules - Systemd: use list comprehension instead of if-then-else - Manifest: use operator, replace case with maybe - Deployer: use newtype, use flip removeService - Caddy: use newtype for single-field types --- Omni/Deploy/Manifest.hs | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'Omni/Deploy/Manifest.hs') diff --git a/Omni/Deploy/Manifest.hs b/Omni/Deploy/Manifest.hs index bbbda95..13dd47a 100644 --- a/Omni/Deploy/Manifest.hs +++ b/Omni/Deploy/Manifest.hs @@ -71,7 +71,7 @@ instance Aeson.FromJSON Artifact where parseJSON = Aeson.withObject "Artifact" <| \o -> Artifact - <$> o + o @@ -95,7 +95,7 @@ instance Aeson.FromJSON Exec where parseJSON = Aeson.withObject "Exec" <| \o -> Exec - <$> o + o .:? "user" @@ -126,7 +126,7 @@ instance Aeson.FromJSON Http where parseJSON = Aeson.withObject "Http" <| \o -> Http - <$> o + o .:? "path" @@ -154,7 +154,7 @@ instance Aeson.FromJSON Systemd where parseJSON = Aeson.withObject "Systemd" <| \o -> Systemd - <$> o + o @@ -191,7 +191,7 @@ instance Aeson.FromJSON Hardening where parseJSON = Aeson.withObject "Hardening" <| \o -> Hardening - <$> o + o @@ -234,7 +234,7 @@ instance Aeson.FromJSON Service where parseJSON = Aeson.withObject "Service" <| \o -> Service - <$> o + o .: "artifact" @@ -286,7 +286,7 @@ instance Aeson.FromJSON Manifest where parseJSON = Aeson.withObject "Manifest" <| \o -> Manifest - <$> o + o @@ -515,9 +515,7 @@ move args Exit.exitWith (Exit.ExitFailure 1) Right svc -> do manifest <- loadManifestFromS3 - m <- case manifest of - Nothing -> createEmptyManifest - Just existing -> pure existing + m <- maybe createEmptyManifest pure manifest case findService (serviceName svc) m of Just _ -> do Log.fail ["manifest", "service already exists:", serviceName svc] -- cgit v1.2.3