1
1
mirror of https://github.com/aelve/guide.git synced 2024-11-22 03:12:58 +03:00

Enable all unobjectionable extensions (#384)

* Enable OverloadedStrings by default

* Remove pragmas for default extensions

* Enable some other extensions

* Enable TemplateHaskell
This commit is contained in:
Artyom Kazak 2019-08-20 07:40:28 +03:00 committed by mergify[bot]
parent ce62066598
commit 0c50de646b
58 changed files with 20 additions and 215 deletions

View File

@ -1,6 +1,7 @@
# Help Hlint parse our code
- arguments:
- -XTypeApplications
- -XQuasiQuotes
# Force qualified imports to be imported consistently.
- modules:

View File

@ -36,8 +36,24 @@ default-extensions:
- ConstraintKinds
- InstanceSigs
- DerivingStrategies
- TemplateHaskellQuotes
- ScopedTypeVariables
- OverloadedStrings
- TypeOperators
- KindSignatures
- DataKinds
- StandaloneDeriving
- TypeFamilies
- GADTs
- DefaultSignatures
- RoleAnnotations
- QuasiQuotes
- DeriveLift
- PackageImports
- OverloadedLabels
- DeriveDataTypeable
- PatternSynonyms
- NamedFieldPuns
- TemplateHaskell
library:
source-dirs: src

View File

@ -1,5 +1,3 @@
{-# LANGUAGE OverloadedStrings #-}
-- | Rendered documentation for the API.
module Guide.Api.Docs
(

View File

@ -1,8 +1,4 @@
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
module Guide.Api.Error

View File

@ -1,6 +1,4 @@
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
-- | 'Guider' monad with 'Config' to replace servant's 'Handler'.
module Guide.Api.Guider

View File

@ -1,9 +1,4 @@
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -Wno-missing-export-lists #-}

View File

@ -1,9 +1,4 @@
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Guide.Api.Server
(

View File

@ -1,12 +1,4 @@
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}

View File

@ -1,11 +1,5 @@
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE UndecidableInstances #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}

View File

@ -1,6 +1,3 @@
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -Wno-missing-export-lists #-}
-- | App module defines types used by the Spock framework.

View File

@ -1,7 +1,3 @@
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeApplications #-}
-- | Methods for working with archive.org. Right now the admin interface
-- provides a list of broken links together with links to their archived
-- copies; in the future we might add automatic archival and automatic link

View File

@ -1,6 +1,3 @@
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
-- | Guide's command line interface.
--
-- Run @guide --help@ to see available commands.

View File

@ -1,6 +1,3 @@
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
-- | Server config. For instance, the admin password is stored here, as well
-- as the base url (for correct link generation in feeds).
module Guide.Config

View File

@ -1,6 +1,3 @@
{-# LANGUAGE OverloadedStrings #-}
-- | Connect to the Guide database.
module Guide.Database.Connection
( connect

View File

@ -1,8 +1,3 @@
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE OverloadedLabels #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TypeOperators #-}
-- | Delete queries.
module Guide.Database.Queries.Delete
(

View File

@ -1,9 +1,3 @@
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE OverloadedLabels #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TypeOperators #-}
-- | Insert queries.
module Guide.Database.Queries.Insert
(

View File

@ -1,8 +1,4 @@
{-# LANGUAGE ApplicativeDo #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE OverloadedLabels #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TypeOperators #-}
-- | Read-only database queries.

View File

@ -1,11 +1,3 @@
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE OverloadedLabels #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TypeOperators #-}
-- | Update queries.
module Guide.Database.Queries.Update
(
-- * Category

View File

@ -1,7 +1,3 @@
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
-- | Schemas to create table for guide database
module Guide.Database.Schema
(

View File

@ -1,10 +1,3 @@
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE OverloadedLabels #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TypeOperators #-}
-- | Types for postgres database
module Guide.Database.Types
(

View File

@ -1,12 +1,7 @@
{-# LANGUAGE MonoLocalBinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE DefaultSignatures #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE OverloadedLabels #-}
{-# LANGUAGE TemplateHaskell #-}
-- | Utilities for working with Postgres.
module Guide.Database.Utils

View File

@ -1,7 +1,3 @@
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
-- | Diff- and merge-related things.
module Guide.Diff
(

View File

@ -1,7 +1,3 @@
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PatternSynonyms #-}
-- | Prepare text for diffing or merging by breaking it into tokens (like
-- links or Markdown elements).
module Guide.Diff.Tokenize

View File

@ -1,7 +1,4 @@
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
-- | All rest API handlers.
module Guide.Handlers

View File

@ -1,8 +1,6 @@
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# OPTIONS_GHC -Wno-missing-export-lists #-}

View File

@ -1,4 +1,3 @@
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE FlexibleContexts #-}
module Guide.Logger.Functions

View File

@ -1,5 +1,3 @@
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE FlexibleContexts #-}
module Guide.Logger.Run

View File

@ -1,5 +1,3 @@
{-# LANGUAGE StandaloneDeriving #-}
{-# OPTIONS_GHC -fno-warn-orphans #-} -- for "instance Read Df1.Level"
-- | The logger monad and associated types.

View File

@ -1,9 +1,4 @@
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
-- | Description : The main module that starts the server.
module Guide.Main

View File

@ -1,9 +1,5 @@
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TemplateHaskell #-}
-- | Everything concerning rendering and processing Markdown.

View File

@ -1,6 +1,3 @@
{-# LANGUAGE OverloadedStrings #-}
-- | Functions for interacting with Matomo (<https://matomo.org/>, our web
-- analytics).
--

View File

@ -1,7 +1,3 @@
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE OverloadedStrings #-}
module Guide.Routes
(
addRoute,

View File

@ -1,7 +1,4 @@
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeFamilies #-}
-- | Spock state, functions for manipulating it, handler helpers, and so on.

View File

@ -1,9 +1,4 @@
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
module Guide.Session
(

View File

@ -1,10 +1,5 @@
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}

View File

@ -1,7 +1,3 @@
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TemplateHaskell #-}
-- | Types for analytics.
--
-- * We collect information about 'Action's that users perform. An action

View File

@ -1,11 +1,5 @@
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TemplateHaskell #-}
-- | Core types for content.

View File

@ -1,7 +1,3 @@
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TemplateHaskell #-}
-- | Types for edits.
--
-- Every content edit is associated with an 'Edit', which is stored in the
@ -254,7 +250,7 @@ instance Migrate Edit_v8 where
EditAddCategory_v8
{ editCategoryUid_v8 = editCategoryUid_v7 x
, editCategoryTitle_v8 = editCategoryTitle_v7 x
, editCategoryGroup_v8 = toText "Miscellaneous"
, editCategoryGroup_v8 = "Miscellaneous"
} |],
CopyM "EditAddItem",
CopyM "EditAddPro",

View File

@ -1,9 +1,3 @@
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
-- | Deprecated as of 2019-07-25.
--
-- TODO: remove after we have migrated from acid-state.

View File

@ -1,8 +1,3 @@
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
module Guide.Types.Session
(
GuideData (..),

View File

@ -1,7 +1,3 @@
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TemplateHaskell #-}
-- | A type for users. Currently unused.
module Guide.Types.User
(

View File

@ -1,12 +1,6 @@
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}

View File

@ -1,8 +1,4 @@
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
-- | All views and all rendering logic.

View File

@ -1,6 +1,5 @@
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -Wno-missing-export-lists #-}

View File

@ -1,6 +1,5 @@
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -Wno-name-shadowing #-}
{-# OPTIONS_GHC -Wno-missing-export-lists #-}

View File

@ -1,5 +1,4 @@
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
-- | Category rendering.

View File

@ -1,6 +1,3 @@
{-# LANGUAGE OverloadedStrings #-}
-- | Item rendering.
--
-- The main functions this module provides are 'renderItem' and

View File

@ -1,8 +1,5 @@
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
-- | Page rendering.

View File

@ -1,5 +1,4 @@
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
-- | Various HTML utils, Mustache utils, etc.
module Guide.Views.Utils

View File

@ -1,4 +1,3 @@
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-name-shadowing #-}
-- | Lucid rendering for inputs and form fields.

View File

@ -1,6 +1,3 @@
{-# LANGUAGE NoImplicitPrelude #-}
-- | Imports used in the whole codebase. (All modules import this one
-- instead of the "Prelude".)
module Imports
@ -48,7 +45,7 @@ import GHC.Stack as X (HasCallStack)
-- Don't let HLint complain about Data.ByteString being imported as
-- something other than "BS" (and so on for other modules)
{-# ANN module "HLint: ignore Avoid restricted qualification" #-}
{-# ANN module ("HLint: ignore Avoid restricted qualification" :: String) #-}
-- | Short type for lazy ByteString
type LByteString = BSL.ByteString

View File

@ -1,7 +1,3 @@
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE NoImplicitPrelude #-}
-- | Integration tests for new API methods.
module ApiSpec (tests) where

View File

@ -1,6 +1,3 @@
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE QuasiQuotes #-}
-- | Tests for logging of errors.
module LogSpec (tests) where

View File

@ -1,6 +1,3 @@
{-# LANGUAGE NoImplicitPrelude #-}
module Main (main) where
-- Shared imports

View File

@ -1,7 +1,3 @@
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
module MarkdownSpec (tests) where
-- Shared imports

View File

@ -1,7 +1,3 @@
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
module MergeSpec (tests) where
-- Shared imports

View File

@ -1,9 +1,5 @@
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE IncoherentInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# OPTIONS_GHC -fno-warn-orphans #-} -- for "instance MonadFail WD"

View File

@ -1,8 +1,5 @@
{-# LANGUAGE IncoherentInstances #-}
{-# LANGUAGE MonoLocalBinds #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
module WebSpec (tests) where