| Commit message (Collapse) | Author | Age |
|
|
|
| |
Co-authored-by: 1computer1 <onecomputer00@gmail.com>
|
| |
|
|
|
|
| |
See #320
|
|
|
|
|
|
|
|
|
| |
* Make sorting deriving list optional
Not everyone wants their typeclasses sorted.
* Remove redundant code
Co-authored-by: Łukasz Gołębiewski <lukasz.golebiewski@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch swaps out the parsing library from `haskell-src-exts` to
`ghc-lib-parser`, which gives us better compatibility with GHC.
Because almost every module heavily used the Haskell AST provided by
`haskell-src-exts`, this was a huge effort and it would not have been possible
without Felix Mulder doing an initial port, GSoC student Beatrice Vergani
porting several other steps, and Łukasz Gołębiewski and Paweł Szulc who helped
me finish up things in the home stretch.
I've generally tried to keep styling 100% compatible with what was there before,
but some issues may have unintentionally slipped in so please report those.
This introduces one new import styling contributed by Felix: when wrapping
import lists over multiple lines, you can repeat the module name, e.g.:
import Control.Monad.Except as X (ExceptT (..), MonadError (..), liftEither)
import Control.Monad.Except as X (runExceptT, withExceptT)
This is activated by using `import_align: repeat`.
Secondly, a new Step was added, `module_header`, which formats the export list
of a module, including the trailing `where` clause. Details for this new step
can be found in the `data/stylish-haskell.yaml`.
Co-Authored-By: Beatrice Vergani <beatrice.vergani11@gmail.com>
Co-Authored-By: Paweł Szulc <paul.szulc@gmail.com>
Co-Authored-By: Łukasz Gołębiewski <lukasz.golebiewski@gmail.com>
Co-Authored-By: Felix Mulder <felix.mulder@klarna.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Initial test describing simplest scenario for Data step
Co-authored-by: Łukasz Gołębiewski <lukasz.golebiewski@gmail.com>
* [sanity-check] Delete data defs
* Extract changeDecl
Co-authored-by: Łukasz Gołębiewski <lukasz.golebiewski@gmail.com>
* First green test :-)
* Cover case where there are more then one field in data type declaration
Co-authored-by: Łukasz Gołębiewski <lukasz.golebiewski@gmail.com>
* 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 <lukasz.golebiewski@gmail.com>
* Add pending case06
Co-authored-by: Łukasz Gołębiewski <lukasz.golebiewski@gmail.com>
* Fix case 06
Co-authored-by: Łukasz Gołębiewski <lukasz.golebiewski@gmail.com>
* Add case07
Co-authored-by: Łukasz Gołębiewski <lukasz.golebiewski@gmail.com>
* Add second phantom case
* Add records to config
* Make indent size configurable for records
Co-authored-by: Paweł Szulc <paul.szulc@gmail.com>
* Fix warnings in Data.hs
* Process derivings during record formatting
Co-authored-by: Paweł Szulc <paul.szulc@gmail.com>
* Do not format when context is present
Co-authored-by: Paweł Szulc <paul.szulc@gmail.com>
* Add case 11 - deriving with DerivingStrategies
* Bugfix: do not remove empty data declarations
Co-authored-by: Paweł Szulc <paul.szulc@gmail.com>
* 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 <lukasz.golebiewski@gmail.com>
* Refactor datas function
Co-authored-by: Łukasz Gołębiewski <lukasz.golebiewski@gmail.com>
* 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 <lukasz.golebiewski@gmail.com>
* Clean-up Data.hs
* Refactor Data.hs
Co-authored-by: Pawel Szulc <paul.szulc@gmail.com>
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|\
| |
| | |
Add newline format option
|
| | |
|
| | |
|
|/ |
|
| |
|
| |
|
|
|
|
|
| |
new line-multiline: Import list will start on new line when it's
short enough to fit to single line. Otherwise it'll be multiline.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
* Rename `compact' to `compact_line'.
* Added the description for new style in .stylish-haskell.yml
* Added test case for `compact_line'.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This mode is like 'global', but doesn't add paddding for non-existent qualified
imports.
For example, with 'global'
import A
import B
is always transformed to
import A
import B
even if there are no qualified imports in the whole file.
|
|
|