summaryrefslogtreecommitdiffhomepage
path: root/tests
Commit message (Collapse)AuthorAge
* Add new option for aligning groups of adjacent itemsJasper Van der Jeugt2020-10-08
| | | | Co-authored-by: 1computer1 <onecomputer00@gmail.com>
* SimpleAlign: add multi_way_if flag in configJasper Van der Jeugt2020-10-08
|
* Add support for aligning multi way ifs1Computer12020-10-08
|
* Fix some issues with record field paddingJasper Van der Jeugt2020-10-07
| | | See #318 and #319
* ModuleHeader: Add separate_lists optionJasper Van der Jeugt2020-10-07
| | | | See #320
* Imports: Respect separate_lists for (..) importsJasper Van der Jeugt2020-10-07
| | | | Fixes #320
* Refactor Squash testsJasper Van der Jeugt2020-10-06
|
* Make sorting deriving list optional (#316)Maxim Koltsov2020-10-05
| | | | | | | | | * Make sorting deriving list optional Not everyone wants their typeclasses sorted. * Remove redundant code Co-authored-by: Łukasz Gołębiewski <lukasz.golebiewski@gmail.com>
* Clean up/unify import testsJasper Van der Jeugt2020-10-05
|
* Fix "group" import sort with multi-line importsMaxim Koltsov2020-10-05
| | | | | | | | When some import line spans multuple lines, e.g. when import list is long, stylish-haskell breaks a group at this line, leading to bad result. This commits makes sure that import groups are recognized solely by empty lines.
* Add a test to cover Imports duplicate removalJonatan Borkowski2020-10-05
| | | Fixes #184
* Use ghc-lib-parser rather than haskell-src-extsJasper Van der Jeugt2020-10-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Correct a typo in Step/Data/Tests.hs (#272)Felix Yan2020-02-18
|
* Introduce nicer style for records (#266)Maxim Koltsov2020-02-17
|
* Add -r flag to recursively find Haskell filesAkos Marton2020-02-15
|
* Disable formatting of data types without records (#265)Maxim Koltsov2020-02-02
|
* Small test tweaksJasper Van der Jeugt2020-01-26
| | | | * Use `withTestDirTree` in StylishSpec * Move StylishSpec module
* Expose "format" function in Sylish.hs (#259)Łukasz Gołębiewski2020-01-26
| | | | | | | | | | | | | | * Expose "format" function in Sylish.hs It's going to be needed for the haskell-ide integration * Update tests/Language/Haskell/StylishSpec.hs Co-Authored-By: Jasper Van der Jeugt <jaspervdj@gmail.com> * Remove empty line Co-authored-by: Jasper Van der Jeugt <jaspervdj@gmail.com>
* Fix records with comments (#257)Pawel Szulc2020-01-24
| | | | | | | | | | * Format records where comments are in the same line as the field name * Fix records format, records with comments will now be formatted * Fix formatting of comments below Co-authored-by: Łukasz Gołębiewski <lukasz.golebiewski@gmail.com>
* Support for records formatting (#256)Łukasz Gołębiewski2020-01-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* Allow setting "columns: null" to disable all wrappingChris Martin2020-01-18
|
* Make language extension prefix configurableFlavio Corpa2019-11-20
|
* Read extensions from cabal fileGeorgy Lukyanov2019-10-28
|
* Respect page breaks alone in a lineChris Perivolaropoulos2019-06-12
| | | | | | Page breaks are an old but effective way of bookmarking a file. They usually are single character lines. Stylish removes them as whitespace characters, and they are from the compiler's point of view but not from an editor's perspective.
* Add with_module_name option to list_alignRupert Horlick2019-06-12
|
* Add new step to squash multiple spaces between some elementsMartin Huschenbett2018-05-01
|
* Support alignment of cases with a single guardJasper Van der Jeugt2018-04-26
|
* Avoid unpaired parenthesis when import doesn't specify any itemsMatthew Kennerly2017-11-28
| | | Fix #185
* Remove shebang lines at the beginning of fileVaibhav Sagar2017-08-23
|
* Add `imports.list_same_align` optionYuriy Syrovetskiy2017-06-19
|
* Add space_surround option to import stylingLinus Arver2017-05-09
|
* Take package imports into account when prettifying importsArtyom Kazak2017-04-24
| | | Fixes #106
* Deduplicate import specs (#165)Artyom Kazak2017-04-22
| | | Fixes #163
* Don't leave #-} hangingArtyom2017-04-17
| | | | Fixes #154
* Remove MagicHash from whitelisted extensions (#160)Artyom Kazak2017-04-15
| | | Fixes #159.
* reduce unnecessary spacesMoritz Drexl2016-12-28
|
* keep `safe` and `{-# SOURCE #-}` import annotationsMoritz Drexl2016-12-13
|
* Remove XmlSyntax from whitelisted extensionsJasper Van der Jeugt2016-08-28
|
* Export Import options & add defaultJasper Van der Jeugt2016-08-23
|
* list_padding: module_nameOleg Grenrus2016-08-03
|
* Special setting for empty import listsOleg Grenrus2016-08-01
|
* Move records step into simple_alignJasper Van der Jeugt2016-07-23
|
* Move Cases step to SimpleAlignJasper Van der Jeugt2016-07-23
|
* Add a set of default language extensions for parsingLangston Barrett2016-07-07
| | | | | See the comment for a detailed explanation. Fixes jaspervdj/stylish-haskell#117
* Simple alignment for top-level casesJasper Van der Jeugt2016-07-03
|
* Add alignment for some case expressionsJasper Van der Jeugt2016-07-03
|
* Record alignment takes max columns into accountJasper Van der Jeugt2016-07-03
|
* Remove shebang from input before attempting to extract extension pragmas.Mathew Mills2016-04-27
|
* New import list optionOndřej Janošík2015-09-21
| | | | | 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.
* Sorting of import sub-listsOndřej Janošík2015-09-21
|