From bd85f2ba74a8c796a387622d6a1a75f22023e8ce Mon Sep 17 00:00:00 2001 From: Jake Wheat Date: Mon, 7 Oct 2024 12:17:25 +0100 Subject: [PATCH] fix website generation, update stack, a few small tweaks --- Makefile | 2 +- release_checklist | 2 +- simple-sql-parser.cabal | 4 ---- stack.yaml | 2 +- stack.yaml.lock | 8 ++++---- website/RenderTestCases.hs | 3 ++- website/render-test-cases.cabal | 3 +++ 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index 9043d35..83aa70d 100644 --- a/Makefile +++ b/Makefile @@ -32,7 +32,7 @@ parserexe : cabal build -fparserexe SimpleSQLParserTool .PHONY : all -all : build test parserexe website +all : build test parserexe ############################################### diff --git a/release_checklist b/release_checklist index 79dbd05..22036f6 100644 --- a/release_checklist +++ b/release_checklist @@ -43,7 +43,7 @@ ghcup install stack [latest from the list on stackage.org] stack test ~~~~ -Run the tests on the previous 2 ghcs latest point releases, and the latest ghc, each with the latest cabal-install they support (e.g. as of the start of 2024, these three ghc versions are 9.8.1, 9.6.4, 9.4.8). This is now trivial to do with ghcup, amazing progress in Haskell tools in recent years. +Run the tests on the previous 2 ghcs latest point releases, and the latest ghc, each with the latest cabal-install they support (e.g. as of October 2024, these three ghc versions are 9.10.1, 9.8.2, 9.6.6). This is now trivial to do with ghcup, amazing progress in Haskell tools in recent years. Build the release tarball, run a test with an example using this tarball: diff --git a/simple-sql-parser.cabal b/simple-sql-parser.cabal index 7f83645..b171f08 100644 --- a/simple-sql-parser.cabal +++ b/simple-sql-parser.cabal @@ -29,10 +29,6 @@ Flag parserexe Description: Build SimpleSQLParserTool exe Default: False -Flag testexe - Description: Build Testing exe - Default: False - common shared-properties default-language: Haskell2010 build-depends: base >=4 && <5, diff --git a/stack.yaml b/stack.yaml index d2b4751..92438d5 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,7 +1,7 @@ # For more information, see: http://docs.haskellstack.org/en/stable/yaml_configuration.html # Specifies the GHC version and set of packages available (e.g., lts-3.5, nightly-2015-09-21, ghc-7.10.2) -resolver: lts-22.5 +resolver: lts-22.37 # Local packages, usually specified by relative directory name packages: diff --git a/stack.yaml.lock b/stack.yaml.lock index 0690a40..45602e1 100644 --- a/stack.yaml.lock +++ b/stack.yaml.lock @@ -13,7 +13,7 @@ packages: hackage: megaparsec-9.6.1 snapshots: - completed: - sha256: 90e6fcdcf6706918ef022ab01214828c550ee637a2d50f4fe96b15742b8bced1 - size: 714102 - url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/22/5.yaml - original: lts-22.5 + sha256: c6274f9587d6bf40b6aaa7d1092684c37a2d8bb1e0df999ae0e2b755db15682d + size: 720026 + url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/22/37.yaml + original: lts-22.37 diff --git a/website/RenderTestCases.hs b/website/RenderTestCases.hs index 7234c04..07d1389 100644 --- a/website/RenderTestCases.hs +++ b/website/RenderTestCases.hs @@ -41,7 +41,8 @@ doc _ (LexTest d str _ _) = doc _ (LexFails d str _) = [Row (L.fromStrict str) (showResultL $ L.lexSQL d False "" Nothing str)] doc _ (GeneralParseFailTest {}) = [] - +-- todo: find some way to render error message examples in a readable way +doc _ (GoldenErrorTest {}) = [] showResult :: Show a => Either P.ParseError a -> L.Text showResult = either (("Left\n" <>) . L.fromStrict . P.prettyError) (L.pack . ppShow) diff --git a/website/render-test-cases.cabal b/website/render-test-cases.cabal index d4306b8..c945a6f 100644 --- a/website/render-test-cases.cabal +++ b/website/render-test-cases.cabal @@ -18,6 +18,8 @@ executable RenderTestCases pretty-show, hspec-expectations, raw-strings-qq, + hspec-golden, + filepath, default-language: Haskell2010 ghc-options: -Wall -O0 @@ -38,6 +40,7 @@ executable RenderTestCases Language.SQL.SimpleSQL.Pretty Language.SQL.SimpleSQL.QueryExprComponents Language.SQL.SimpleSQL.QueryExprs + Language.SQL.SimpleSQL.QueryExprParens Language.SQL.SimpleSQL.SQL2011AccessControl Language.SQL.SimpleSQL.SQL2011Bits Language.SQL.SimpleSQL.SQL2011DataManipulation