depot/third_party/nixpkgs/pkgs/development/haskell-modules/patches/haskell-ci-optparse-applicative-0.17-ShellCheck-0.8.patch
Default email a3d4720129 Project import generated by Copybara.
GitOrigin-RevId: e182da8622a354d44c39b3d7a542dc12cd7baa5f
2022-12-28 22:21:41 +01:00

54 lines
2.2 KiB
Diff

From 0cc6f0f8de1776d0b5851459d22a0997dfd735ce Mon Sep 17 00:00:00 2001
From: Oleg Grenrus <oleg.grenrus@iki.fi>
Date: Wed, 25 May 2022 14:09:49 +0300
Subject: [PATCH] Use ShellCheck-0.8.0 and optparse-applicative-0.17
Adapted from 0cc6f0f8de1776d0b5851459d22a0997dfd735ce to apply on top of
haskell-ci-0.14.3.
Co-Authored-By: sternenseemann <sternenseemann@systemli.org>
---
haskell-ci.cabal | 4 ++--
src/HaskellCI/GitHub.hs | 7 ++++---
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/haskell-ci.cabal b/haskell-ci.cabal
index 273bd422..6848402c 100644
--- a/haskell-ci.cabal
+++ b/haskell-ci.cabal
@@ -167,14 +167,14 @@ library haskell-ci-internal
, ini ^>=0.4.1
, lattices ^>=2
, network-uri ^>=2.6.1.0
- , optparse-applicative ^>=0.16.1.0
+ , optparse-applicative ^>=0.17.0.0
, temporary ^>=1.3
, unordered-containers ^>=0.2.10.0
, zinza ^>=0.2
-- ShellCheck. Would need newer transformers for older GHC
if flag(shellcheck)
- build-depends: ShellCheck ==0.7.2
+ build-depends: ShellCheck ==0.8.0
executable haskell-ci
main-is: Main.hs
diff --git a/src/HaskellCI/GitHub.hs b/src/HaskellCI/GitHub.hs
index f1a402e6..a2c6e4f6 100644
--- a/src/HaskellCI/GitHub.hs
+++ b/src/HaskellCI/GitHub.hs
@@ -653,9 +653,10 @@ makeGitHub _argv config@Config {..} gitconfig prj jobs@JobVersions {..} = do
setup hvrppa ghcup
| allGHCUP = traverse_ liftSh ghcup
| not anyGHCUP = traverse_ liftSh hvrppa
- -- 2192: ${{ ...}} will match (ShellCheck think it doesn't)
- -- 2129: individual redirects
- | otherwise = sh' [2193, 2129] $ unlines $
+ -- SC2192: ${{ ...}} will match (ShellCheck think it doesn't)
+ -- SC2129: individual redirects
+ -- SC2296: Parameter expansions can't start with {. Double check syntax. -- ${{ }} in YAML templating.
+ | otherwise = sh' [2193, 2129, 2296] $ unlines $
[ "if [ \"${{ matrix.setup-method }}\" = ghcup ]; then"
] ++
[ " " ++ shToString s