Skip to content

Warn if -- token is found. Don't warn if it's "--". #4973

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 25, 2017

Conversation

phadej
Copy link
Collaborator

@phadej phadej commented Dec 24, 2017

Resolves #2681

Cabal files don't have trailing line comments. In many fields they
simply cause parse errors, but e.g. in extra-source-files
virtually everything is accepted. As there is simple
work around if people actually want double-dash, let's warn
about bare one.

Please include the following checklist in your PR:

  • Patches conform to the coding conventions.
  • Any changes that could be relevant to users have been recorded in the changelog.
  • The documentation has been updated, if necessary.
  • If the change is docs-only, [ci skip] is used to avoid triggering the build bots.

Please also shortly describe how you tested your change. Bonus points for added tests!

@phadej phadej requested review from 23Skidoo and hvr December 24, 2017 18:11
Copy link
Member

@23Skidoo 23Skidoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM modulo one minor comment.

when (s == "--") $ parsecWarning PWTDoubleDash $ unwords
[ "Double-dash token found."
, "Note: there are no end-of-line comments in .cabal files, only whole line comments."
, "Use \"--\" to silent this warning, if you actually want -- token"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/silent/silence/

@phadej phadej force-pushed the issue-2681-suspicious-token branch from a0c12cd to 0223f6a Compare December 24, 2017 22:47
Resolves haskell#2681

Cabal files don't have trailing line comments. In many fields they
simply cause parse errors, but e.g. in extra-source-files
virtually everything is accepted. As there is simple
work around if people actually want double-dash, let's warn
about bare one.
@phadej phadej force-pushed the issue-2681-suspicious-token branch from 0223f6a to 93a2171 Compare December 25, 2017 10:54
@phadej phadej merged commit 70fd4d2 into haskell:master Dec 25, 2017
@phadej phadej deleted the issue-2681-suspicious-token branch December 25, 2017 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants