From cf29f4792d9ac030c2057e5e69bd62598fd6b994 Mon Sep 17 00:00:00 2001 From: Yoo Chung Date: Wed, 20 Dec 2023 03:35:32 -0500 Subject: [PATCH] Merge main. (#140) * Remove comment. * Format with recent version of Ormolu. * Don't have Dependabot update Docker image references. * Bump haskell-actions/setup from 2.5.3 to 2.6.0 (#137) Bumps [haskell-actions/setup](https://github.com/haskell-actions/setup) from 2.5.3 to 2.6.0. - [Release notes](https://github.com/haskell-actions/setup/releases) - [Commits](https://github.com/haskell-actions/setup/compare/7398b0c373cccf9ed5dfddae26f77ed02dea4967...75089801accaefd2e8c4a899d6101caa5bdcbc77) --- updated-dependencies: - dependency-name: haskell-actions/setup dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump docker/metadata-action from 5.2.0 to 5.3.0 (#136) Bumps [docker/metadata-action](https://github.com/docker/metadata-action) from 5.2.0 to 5.3.0. - [Release notes](https://github.com/docker/metadata-action/releases) - [Commits](https://github.com/docker/metadata-action/compare/e6428a5c4e294a61438ed7f43155db912025b6b3...31cebacef4805868f9ce9a0cb03ee36c32df2ac4) --- updated-dependencies: - dependency-name: docker/metadata-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump actions/stale from 8.0.0 to 9.0.0 (#135) Bumps [actions/stale](https://github.com/actions/stale) from 8.0.0 to 9.0.0. - [Release notes](https://github.com/actions/stale/releases) - [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/stale/compare/1160a2240286f5da8ec72b1c0816ce2481aabf84...28ca1036281a5e5922ead5184a1bbf96e5fc984e) --- updated-dependencies: - dependency-name: actions/stale dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump actions/upload-artifact from 3.1.3 to 4.0.0 (#138) Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3.1.3 to 4.0.0. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/a8a3f3ad30e3422c9c7b888a15615d19a852ae32...c7d193f32edcb7bfad88892161225aeda64e9392) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Update to Haskell Stack LTS 22.0. --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/dependabot.yaml | 11 +++++--- .github/workflows/build.yaml | 4 +-- .github/workflows/release.yaml | 2 +- .github/workflows/scorecard.yaml | 2 +- .github/workflows/stale.yaml | 2 +- stack.yaml | 4 +-- test/ArgumentsSpec.hs | 43 ++++++++++++++++---------------- 7 files changed, 35 insertions(+), 33 deletions(-) diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml index 8c58682..67dd314 100644 --- a/.github/dependabot.yaml +++ b/.github/dependabot.yaml @@ -8,7 +8,10 @@ updates: schedule: interval: "weekly" - - package-ecosystem: "docker" - directory: "/" - schedule: - interval: "weekly" +# It would be nice to keep these up to date, +# but it's more important to keep versions consistent with the build. +# +# - package-ecosystem: "docker" +# directory: "/" +# schedule: +# interval: "weekly" diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 086b621..d571fc5 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -18,7 +18,7 @@ jobs: steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - uses: haskell-actions/setup@7398b0c373cccf9ed5dfddae26f77ed02dea4967 # v2.5.3 + - uses: haskell-actions/setup@75089801accaefd2e8c4a899d6101caa5bdcbc77 # v2.6.0 with: enable-stack: true @@ -49,7 +49,7 @@ jobs: - name: Upload coverage report if: ${{ inputs.coverage }} - uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 + uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.0 with: name: coverage-report path: ${{ steps.coverage.outputs.report }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 8512a5b..2d36eef 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -34,7 +34,7 @@ jobs: - name: Extract metadata id: meta - uses: docker/metadata-action@e6428a5c4e294a61438ed7f43155db912025b6b3 # v5.2.0 + uses: docker/metadata-action@31cebacef4805868f9ce9a0cb03ee36c32df2ac4 # v5.3.0 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} tags: | diff --git a/.github/workflows/scorecard.yaml b/.github/workflows/scorecard.yaml index cce5dee..201d58b 100644 --- a/.github/workflows/scorecard.yaml +++ b/.github/workflows/scorecard.yaml @@ -45,7 +45,7 @@ jobs: # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF # format to the repository Actions tab. - name: "Upload artifact" - uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 + uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.0 with: name: SARIF file path: results.sarif diff --git a/.github/workflows/stale.yaml b/.github/workflows/stale.yaml index 5001ced..bf0047a 100644 --- a/.github/workflows/stale.yaml +++ b/.github/workflows/stale.yaml @@ -19,7 +19,7 @@ jobs: pull-requests: write steps: - - uses: actions/stale@1160a2240286f5da8ec72b1c0816ce2481aabf84 # v8.0.0 + - uses: actions/stale@28ca1036281a5e5922ead5184a1bbf96e5fc984e # v9.0.0 with: days-before-stale: 90 days-before-close: 30 diff --git a/stack.yaml b/stack.yaml index f893a28..ae11350 100644 --- a/stack.yaml +++ b/stack.yaml @@ -17,9 +17,7 @@ # https://docs.haskellstack.org/en/stable/yaml_configuration/ # Resolver to choose a 'specific' stackage snapshot or a compiler version. -# Use a nightly build for now so that we can build an unreleased version -# of HLint with SARIF support. -resolver: lts-21.24 +resolver: lts-22.0 # User packages to be built. packages: diff --git a/test/ArgumentsSpec.hs b/test/ArgumentsSpec.hs index f1b80d9..93cdeb0 100644 --- a/test/ArgumentsSpec.hs +++ b/test/ArgumentsSpec.hs @@ -45,22 +45,23 @@ spec = do `shouldBe` Nothing prop "argument must have '=' character" $ \s -> - ('=' `notElem` s) ==> - validate [s] - `shouldSatisfy` isJust + ('=' `notElem` s) + ==> validate [s] + `shouldSatisfy` isJust prop "argument must not have duplicate keyword" $ \key v v' -> - '=' `notElem` key ==> \keyValues -> - let otherArgs = map (\(x, y) -> x <> "=" <> y) keyValues - args' = [key <> "=" <> v, key <> "=" <> v'] ++ otherArgs - in forAll (shuffle args') $ \args -> - validate args `shouldSatisfy` isJust + '=' + `notElem` key ==> \keyValues -> + let otherArgs = map (\(x, y) -> x <> "=" <> y) keyValues + args' = [key <> "=" <> v, key <> "=" <> v'] ++ otherArgs + in forAll (shuffle args') $ \args -> + validate args `shouldSatisfy` isJust prop "argument must have explicitly allowed keyword" $ \key v -> - ('=' `notElem` key) ==> - (key `notElem` ["binary", "path", "hints", "category", "token"]) ==> - validate [key <> "=" <> v] - `shouldSatisfy` isJust + ('=' `notElem` key) + ==> (key `notElem` ["binary", "path", "hints", "category", "token"]) + ==> validate [key <> "=" <> v] + `shouldSatisfy` isJust prop "path may not look like a flag" $ \pathSuffix paths' -> forAll (shuffle $ ("-" <> pathSuffix) : paths') $ \paths -> @@ -115,15 +116,15 @@ spec = do && (hints /= "") && (category /= "") && (token /= "") - ==> forAll - ( shuffle - [ "binary=" <> binary, - "path=" <> paths, - "hints=" <> hints, - "category=" <> category, - "token=" <> token - ] - ) + ==> forAll + ( shuffle + [ "binary=" <> binary, + "path=" <> paths, + "hints=" <> hints, + "category=" <> category, + "token=" <> token + ] + ) $ \args -> translate args `shouldBe` ( binary,