diff options
| author | Ben Sima <ben@bensima.com> | 2025-12-16 14:14:41 -0500 |
|---|---|---|
| committer | Ben Sima <ben@bensima.com> | 2025-12-16 14:14:41 -0500 |
| commit | 260b7b83b0ec396bb880038f4c93f977af0056c5 (patch) | |
| tree | fd6905ac74d0cb366758fd146887629a03c2cf12 /Omni/Deploy/Manifest.hs | |
| parent | bf64b25a2106ec04d91b3e8d7ee9e86fe9ff43ab (diff) | |
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
Diffstat (limited to 'Omni/Deploy/Manifest.hs')
| -rw-r--r-- | Omni/Deploy/Manifest.hs | 18 |
1 files changed, 8 insertions, 10 deletions
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 .:? "type" .!= "nix-closure" <*> o @@ -95,7 +95,7 @@ instance Aeson.FromJSON Exec where parseJSON = Aeson.withObject "Exec" <| \o -> Exec - <$> o + </ o .:? "command" <*> o .:? "user" @@ -126,7 +126,7 @@ instance Aeson.FromJSON Http where parseJSON = Aeson.withObject "Http" <| \o -> Http - <$> o + </ o .: "domain" <*> o .:? "path" @@ -154,7 +154,7 @@ instance Aeson.FromJSON Systemd where parseJSON = Aeson.withObject "Systemd" <| \o -> Systemd - <$> o + </ o .:? "after" .!= ["network-online.target"] <*> o @@ -191,7 +191,7 @@ instance Aeson.FromJSON Hardening where parseJSON = Aeson.withObject "Hardening" <| \o -> Hardening - <$> o + </ o .:? "dynamicUser" .!= False <*> o @@ -234,7 +234,7 @@ instance Aeson.FromJSON Service where parseJSON = Aeson.withObject "Service" <| \o -> Service - <$> o + </ o .: "name" <*> o .: "artifact" @@ -286,7 +286,7 @@ instance Aeson.FromJSON Manifest where parseJSON = Aeson.withObject "Manifest" <| \o -> Manifest - <$> o + </ o .:? "version" .!= 1 <*> 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] |
