Visitar URL original
Support custom separators in CSV Import by lucamolteni · Pull Request #829 · hledgerorg/hledger · GitHub
Skip to content

Support custom separators in CSV Import - #829

Closed
lucamolteni wants to merge 36 commits into
hledgerorg:masterfrom
lucamolteni:cassava
Closed

lucamolteni wants to merge 36 commits into
hledgerorg:masterfrom
lucamolteni:cassava

Conversation

@lucamolteni

Copy link
Copy Markdown
Contributor

Changed the CSV parser from Text.CSV to cassava-megaparsec

use the --separator parameter (default to ,)

there's a new test in the func suite using the semicolon ;

@lucamolteni

Copy link
Copy Markdown
Contributor Author

Ok I already saw there a few warnings, I'm going to fix them

@simonmichael

Copy link
Copy Markdown
Member

Hi @lucamolteni, any work planned on this ? Can we help with anything ?

@lucamolteni

Copy link
Copy Markdown
Contributor Author

Sorry @simonmichael I was on vacation - I'm working on it this week

@lucamolteni

Copy link
Copy Markdown
Contributor Author

I've fixed some of the warnings. How do I get the full list?

I tried with

stack build --ghc-options="-Wall -Werror"

But it seems a bit too much (it shows error from parts I haven't touched)

@simonmichael

simonmichael commented Aug 16, 2018 •

Copy link
Copy Markdown
Member

@lucamolteni I usually see warnings from make ghcid. More thorough is make buildtest (finds warnings in all build targets, with current GHC) or if you have a lot of time and space make buildtestall (tests with all supported GHCs). make buildtest is passing in current master.

@simonmichael simonmichael added A-WISH Some kind of improvement request or proposal. csv The csv file format, csv output format, or generally CSV-related. needs-testing To unblock: needs more developer testing or general usage needs-docs To unblock: needs corresponding documentation or doc updates needs-review To unblock: needs more code/docs/design review by someone needs-rebase To unblock: needs to be rebased against latest master branch labels Aug 16, 2018
@simonmichael

Copy link
Copy Markdown
Member

@lucamolteni

Copy link
Copy Markdown
Contributor Author

@simonmichael I can see why the "needs:docs" tag, but as for the test, don't you think the test I added is enough?

@simonmichael

Copy link
Copy Markdown
Member

It sounded like you were still testing/fixing build warnings, that's what I meant.

@simonmichael

Copy link
Copy Markdown
Member

Hi @lucamolteni, I'm pinging you so I don't forget this PR. I think you are still working on this. Or, if you're finished/stopped and have uploaded latest code for review/help, let me know.

@lucamolteni

Copy link
Copy Markdown
Contributor Author

@simonmichael fixed conflicts

simonmichael added a commit that referenced this pull request Sep 7, 2018
commit 5ba464d
Author: Luca Molteni <volothamp@gmail.com>
Date:   Fri Sep 7 17:54:12 2018 +0200

    Fix CI 2

commit f060ae9
Author: Luca Molteni <volothamp@gmail.com>
Date:   Fri Sep 7 17:30:08 2018 +0200

    Fix CI build

commit af0719a
Author: Luca Molteni <volothamp@gmail.com>
Date:   Fri Sep 7 17:19:01 2018 +0200

    Fix rebase

commit 1a24ddf
Author: Luca Molteni <volothamp@gmail.com>
Date:   Fri Aug 10 16:25:24 2018 +0200

    Fixed some GHC warnings

commit 1ac4339
Author: Luca Molteni <volothamp@gmail.com>
Date:   Fri Aug 10 16:14:49 2018 +0200

    Fix .cabal

commit 422456b
Author: Luca Molteni <volothamp@gmail.com>
Date:   Sun Jul 1 22:56:20 2018 +0200

    Removed to-do list

commit 1118b76
Author: Luca Molteni <volothamp@gmail.com>
Date:   Sun Jul 1 22:53:28 2018 +0200

    Better test

commit 1146ed0
Author: Luca Molteni <volothamp@gmail.com>
Date:   Sun Jul 1 15:32:28 2018 +0200

    Fix parsing

commit 4fc2374
Author: Luca Molteni <volothamp@gmail.com>
Date:   Thu Jun 21 22:11:11 2018 +0200

    Parsing of separator

commit f7a6173
Author: Luca Molteni <volothamp@gmail.com>
Date:   Thu Jun 21 14:29:23 2018 +0200

    Almost separator in options

commit ac8841c
Author: Luca Molteni <volothamp@gmail.com>
Date:   Thu Jun 21 14:16:59 2018 +0200

    Separator in parseCSV

commit 92a8b9f
Author: Luca Molteni <volothamp@gmail.com>
Date:   Thu Jun 21 13:30:41 2018 +0200

    separator option

commit ec417a8
Author: Luca Molteni <volothamp@gmail.com>
Date:   Thu Jun 21 10:45:26 2018 +0200

    Removed one qualified import

commit 8b2f386
Author: Luca Molteni <volothamp@gmail.com>
Date:   Wed Jun 20 14:01:12 2018 +0200

    Removed string conversions

commit a14d0e0
Author: Luca Molteni <volothamp@gmail.com>
Date:   Wed Jun 20 10:23:20 2018 +0200

    custom delimiter in cassava

commit 694d48e
Author: Luca Molteni <volothamp@gmail.com>
Date:   Sun Jun 10 17:51:54 2018 +0200

    Use Text.getContents - remove UTF-8 compatibility library

commit a7ada2c
Author: Luca Molteni <volothamp@gmail.com>
Date:   Sun Jun 10 17:49:34 2018 +0200

    todo list

commit 58ec47d
Author: Luca Molteni <volothamp@gmail.com>
Date:   Sun Jun 10 17:45:22 2018 +0200

    CSV test now has unicode characters

commit b7851e9
Author: Luca Molteni <volothamp@gmail.com>
Date:   Sun Jun 10 16:59:39 2018 +0200

    Use decode from Text

commit 79f59fd
Author: Luca Molteni <volothamp@gmail.com>
Date:   Sun Jun 10 13:28:57 2018 +0200

    Use Text and Lazy Bytestring

commit 470c9bc
Author: Luca Molteni <volothamp@gmail.com>
Date:   Sat Jun 9 15:30:22 2018 +0200

    Use megaparsec error

commit f978848
Author: Luca Molteni <volothamp@gmail.com>
Date:   Sat Jun 9 15:22:07 2018 +0200

    Renamed qualify and remove Parsec

commit 152587f
Author: Luca Molteni <volothamp@gmail.com>
Date:   Sat Jun 9 15:12:36 2018 +0200

    Use cassava mega parsec

commit cf28157
Author: Luca Molteni <volothamp@gmail.com>
Date:   Sat Jun 9 14:01:47 2018 +0200

    Removed Data.Vector

commit 1272e8e
Author: Luca Molteni <volothamp@gmail.com>
Date:   Sat Jun 9 12:16:18 2018 +0200

    Removed Parsec ParseError

commit ae07f04
Author: Luca Molteni <volothamp@gmail.com>
Date:   Sat Jun 9 12:06:14 2018 +0200

    Type sinonim for ParsecError

commit 8e15b25
Author: Luca Molteni <volothamp@gmail.com>
Date:   Sat Jun 9 11:16:08 2018 +0200

    Replaced with typeclasses

commit 1ed46f9
Author: Luca Molteni <volothamp@gmail.com>
Date:   Sat Jun 9 11:01:33 2018 +0200

    Replaced Text/CSV with Cassava

commit 362f411
Author: Luca Molteni <volothamp@gmail.com>
Date:   Sat Jun 9 10:34:37 2018 +0200

    Use cassava parsin instead of Text/CSV

commit 83e678e
Author: Luca Molteni <volothamp@gmail.com>
Date:   Sat Jun 9 08:22:51 2018 +0200

    Text CSV error messages

commit f922df7
Author: Luca Molteni <volothamp@gmail.com>
Date:   Fri Jun 8 21:45:20 2018 +0200

    Better types

commit edd1307
Author: Luca Molteni <volothamp@gmail.com>
Date:   Fri Jun 8 21:34:59 2018 +0200

    Conversion to Text CSV type

commit 0799383
Author: Luca Molteni <volothamp@gmail.com>
Date:   Fri Jun 8 16:06:21 2018 +0200

    First function with cassava

commit e92aeb1
Author: Luca Molteni <volothamp@gmail.com>
Date:   Fri Jun 8 13:47:34 2018 +0200

    Added cassava as dependency

commit 5ea005c
Author: Luca Molteni <volothamp@gmail.com>
Date:   Fri Jun 8 13:18:47 2018 +0200

    Better .gitignore for multi idea modules
simonmichael added a commit that referenced this pull request Sep 7, 2018
@simonmichael

Copy link
Copy Markdown
Member

This has been merged, with some fixups and the flag added to docs. Thanks a lot!

@simonmichael simonmichael removed needs-docs To unblock: needs corresponding documentation or doc updates needs-rebase To unblock: needs to be rebased against latest master branch needs-review To unblock: needs more code/docs/design review by someone needs-testing To unblock: needs more developer testing or general usage labels Sep 7, 2018
simonmichael added a commit that referenced this pull request Sep 7, 2018
@dniku

dniku commented Mar 30, 2019

Copy link
Copy Markdown

Perhaps a better place to configure the separator character is the .rules file, not a command-line argument?

@schoettl

Copy link
Copy Markdown
Contributor

There is already a issue for that #868

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-WISH Some kind of improvement request or proposal. csv The csv file format, csv output format, or generally CSV-related.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants