diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs new file mode 100644 index 0000000..cf8e61e --- /dev/null +++ b/.git-blame-ignore-revs @@ -0,0 +1,6 @@ +# This file is a list of commits to be ignored in commands such as git-blame. To +# make this work, you need to run: +# +# git config blame.ignoreRevsFile .git-blame-ignore-revs +# +### diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 58b08c8..40578fc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,51 +12,44 @@ jobs: strategy: matrix: stack-yaml: - - stack-nightly.yaml # ghc-9.2 - - stack.yaml # ghc-9.0 + - stack-nightly.yaml # ghc-9.8 + - stack.yaml # ghc-9.6 + - stack-lts-21.25.yaml # ghc-9.4 + - stack-lts-20.26.yaml # ghc-9.2 + - stack-lts-19.33.yaml # ghc-9.0 - stack-lts-18.28.yaml # ghc-8.10 - stack-lts-16.31.yaml # ghc-8.8 - stack-lts-14.27.yaml # ghc-8.6 - stack-lts-12.26.yaml # ghc-8.4 fail-fast: false + env: + STACK_YAML: ${{ matrix.stack-yaml }} + steps: - - uses: actions/checkout@v2 - - uses: freckle/stack-cache-action@v1 - with: - stack-yaml: ${{ matrix.stack-yaml }} + - uses: actions/checkout@v4 - id: stack - uses: freckle/stack-action@v3 + uses: freckle/stack-action@v5 with: - stack-yaml: ${{ matrix.stack-yaml }} stack-arguments: --coverage + compiler-tools: hpc-lcov - if: ${{ matrix.stack-yaml == 'stack.yaml' }} name: Reformat coverage - run: | - tix='${{ steps.stack.outputs.local-hpc-root }}/combined/all/all.tix' - stack --resolver lts-18.28 --no-terminal install --copy-compiler-tool hpc-lcov - stack --resolver lts-18.28 --no-terminal exec -- hpc-lcov --file "$tix" + run: stack exec -- hpc-lcov --file '${{ steps.stack.outputs.local-hpc-root }}/combined/all/all.tix' - if: ${{ matrix.stack-yaml == 'stack.yaml' }} name: Upload coverage - uses: codecov/codecov-action@v2 + uses: codecov/codecov-action@v4 with: files: ./lcov.info - - if: ${{ matrix.stack-yaml == 'stack.yaml' }} - uses: freckle/weeder-action@v1 - with: - weeder-version: 2.3.0 - hlint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: rwe/actions-hlint-setup@v1 - - run: | - curl -o .hlint.yaml https://raw.githubusercontent.com/pbrisbin/dotfiles/master/hlint.yaml - - uses: rwe/actions-hlint-run@v2 + - uses: actions/checkout@v4 + - uses: haskell-actions/hlint-setup@v2 + - uses: haskell-actions/hlint-run@v2 with: fail-on: warning diff --git a/.restyled.yaml b/.restyled.yaml index 6d7f543..17f7012 100644 --- a/.restyled.yaml +++ b/.restyled.yaml @@ -1,12 +1,3 @@ ---- restylers: - - stylish-haskell: - include: - - "**/*.hs" - - "!src/Yesod/Paginator/Pages.hs" # avoid DerivingStrategies - - brittany: - include: - - "**/*.hs" - - "!src/Yesod/Paginator/Pages.hs" # avoid DerivingStrategies - - "!example/Main.hs" # HsSpliceE - - "!src/Yesod/Paginator/Widgets.hs" # HsSpliceE + - "!stylish-haskell" + - fourmolu diff --git a/.stylish-haskell.yaml b/.stylish-haskell.yaml deleted file mode 100644 index 37d34b8..0000000 --- a/.stylish-haskell.yaml +++ /dev/null @@ -1,23 +0,0 @@ ---- -steps: - - simple_align: - cases: false - top_level_patterns: false - records: false - - imports: - align: none - list_align: after_alias - pad_module_names: false - long_list_align: new_line_multiline - empty_list_align: right_after - list_padding: 4 - separate_lists: false - space_surround: false - - language_pragmas: - style: vertical - align: false - # https://github.com/jaspervdj/stylish-haskell/issues/75 - remove_redundant: false - - trailing_whitespace: {} -columns: 80 -newline: native diff --git a/Makefile b/Makefile deleted file mode 100644 index 3b579a0..0000000 --- a/Makefile +++ /dev/null @@ -1,42 +0,0 @@ -all: setup build test lint - -.PHONY: setup -setup: - stack setup - stack build \ - --flag yesod-paginator:examples \ - --dependencies-only --test --no-run-tests - stack install hlint weeder - -.PHONY: build -build: - stack build \ - --flag yesod-paginator:examples \ - --pedantic --test --no-run-tests - -.PHONY: test -test: - stack build \ - --flag yesod-paginator:examples \ - --pedantic --test - - -.PHONY: lint -lint: - hlint . - weeder . - -.PHONY: clean -clean: - stack clean - -.PHONY: docs -docs: - stack --work-dir .stack-work-docs build --haddock - -.PHONY: check-nightly -check-nightly: - stack setup --resolver nightly - stack build --resolver nightly \ - --flag yesod-paginator:examples \ - --pedantic --test diff --git a/Setup.hs b/Setup.hs index 9a994af..e8ef27d 100644 --- a/Setup.hs +++ b/Setup.hs @@ -1,2 +1,3 @@ import Distribution.Simple + main = defaultMain diff --git a/brittany.yaml b/brittany.yaml deleted file mode 100644 index d24180f..0000000 --- a/brittany.yaml +++ /dev/null @@ -1,40 +0,0 @@ ---- -conf_debug: - dconf_roundtrip_exactprint_only: false - dconf_dump_bridoc_simpl_par: false - dconf_dump_ast_unknown: false - dconf_dump_bridoc_simpl_floating: false - dconf_dump_config: false - dconf_dump_bridoc_raw: false - dconf_dump_bridoc_final: false - dconf_dump_bridoc_simpl_alt: false - dconf_dump_bridoc_simpl_indent: false - dconf_dump_annotations: false - dconf_dump_bridoc_simpl_columns: false - dconf_dump_ast_full: false -conf_forward: - options_ghc: [] -conf_errorHandling: - econf_ExactPrintFallback: ExactPrintFallbackModeInline - econf_Werror: false - econf_omit_output_valid_check: false - econf_produceOutputOnErrors: false -conf_preprocessor: - ppconf_CPPMode: CPPModeAbort - ppconf_hackAroundIncludes: false -conf_version: 1 -conf_layout: - lconfig_altChooser: - tag: AltChooserBoundedSearch - contents: 3 - lconfig_importColumn: 60 - lconfig_alignmentLimit: 1 - lconfig_indentListSpecial: true - lconfig_indentAmount: 4 - lconfig_alignmentBreakOnMultiline: true - lconfig_cols: 80 - lconfig_indentPolicy: IndentPolicyLeft - lconfig_indentWhereSpecial: true - lconfig_columnAlignMode: - tag: ColumnAlignModeDisabled - contents: 0.7 \ No newline at end of file diff --git a/doctest/Main.hs b/doctest/Main.hs index 2d5ea2c..8e78415 100644 --- a/doctest/Main.hs +++ b/doctest/Main.hs @@ -1,6 +1,6 @@ module Main - ( main - ) where + ( main + ) where import Prelude diff --git a/example/Main.hs b/example/Main.hs index cd16258..73e853d 100644 --- a/example/Main.hs +++ b/example/Main.hs @@ -8,8 +8,8 @@ {-# OPTIONS_GHC -Wno-unused-top-binds #-} module Main - ( main - ) where + ( main + ) where import Prelude @@ -19,15 +19,18 @@ import Yesod.Paginator data App = App -mkYesod "App" [parseRoutes| +mkYesod + "App" + [parseRoutes| / RootR GET |] instance Yesod App where - approot = ApprootRelative - defaultLayout widget = do - pc <- widgetToPageContent widget - withUrlRenderer [hamlet|$newline never + approot = ApprootRelative + defaultLayout widget = do + pc <- widgetToPageContent widget + withUrlRenderer + [hamlet|$newline never $doctype 5
@@ -43,13 +46,13 @@ instance Yesod App where getRootR :: Handler Html getRootR = do - let things' = [1 .. 1142] :: [Int] + let things' = [1 .. 1142] :: [Int] - pages <- paginate 3 things' + pages <- paginate 3 things' - defaultLayout $ do - setTitle "My title" - [whamlet|$newline never + defaultLayout $ do + setTitle "My title" + [whamlet|$newline never