Skip to content

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

Merged
phadej merged 1 commit into
haskell:masterfrom
phadej:issue-2681-suspicious-token
Dec 25, 2017
Merged

phadej merged 1 commit into
haskell:masterfrom
phadej:issue-2681-suspicious-token

Conversation

@phadej

@phadej phadej commented Dec 24, 2017 •

Copy link
Copy Markdown
Collaborator

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

@23Skidoo 23Skidoo left a comment

Copy link
Copy Markdown
Member

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.

Comment thread Cabal/Distribution/Parsec/Class.hs Outdated
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
Copy Markdown
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