From 8065c3c074719bd13db67b5ec74db560609a4e64 Mon Sep 17 00:00:00 2001 From: Łukasz Gołębiewski Date: Thu, 23 Jan 2020 17:43:04 +0100 Subject: Support for records formatting (#256) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Initial test describing simplest scenario for Data step Co-authored-by: Łukasz Gołębiewski * [sanity-check] Delete data defs * Extract changeDecl Co-authored-by: Łukasz Gołębiewski * First green test :-) * Cover case where there are more then one field in data type declaration Co-authored-by: Łukasz Gołębiewski * Add case03 where a type variable is present * Add case04 - multiple declarations * Make case04 pass * Extend tests with case05 Co-authored-by: Łukasz Gołębiewski * Add pending case06 Co-authored-by: Łukasz Gołębiewski * Fix case 06 Co-authored-by: Łukasz Gołębiewski * Add case07 Co-authored-by: Łukasz Gołębiewski * Add second phantom case * Add records to config * Make indent size configurable for records Co-authored-by: Paweł Szulc * Fix warnings in Data.hs * Process derivings during record formatting Co-authored-by: Paweł Szulc * Do not format when context is present Co-authored-by: Paweł Szulc * Add case 11 - deriving with DerivingStrategies * Bugfix: do not remove empty data declarations Co-authored-by: Paweł Szulc * Update README example with ability to format records * Add case12 (Point) * Fix case 12 * Factor out processName * Apply hlint suggestions * Extract constructors helper function * Make 'indent' global * Remove unused Stylish.records method * Fix Config formatting in Config.hs * Extract processConstructor function Co-authored-by: Łukasz Gołębiewski * Refactor datas function Co-authored-by: Łukasz Gołębiewski * Include comments with AST. Two tests are still failing... * Fix cases 15 and 16 * Do not format records when comments within Co-authored-by: Łukasz Gołębiewski * Clean-up Data.hs * Refactor Data.hs Co-authored-by: Pawel Szulc --- README.markdown | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'README.markdown') diff --git a/README.markdown b/README.markdown index 870a40c..54451cc 100644 --- a/README.markdown +++ b/README.markdown @@ -56,10 +56,7 @@ import System.Directory (doesFileExist) import qualified Data.Map as M import Data.Map ((!), keys, Map) -data Point = Point - { pointX, pointY :: Double - , pointName :: String - } deriving (Show) +data Point = Point { pointX, pointY :: Double , pointName :: String} deriving (Show) ``` into: -- cgit v1.2.3