-
Notifications
You must be signed in to change notification settings - Fork 697
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
cabal check: Warn if changelogs are omitted from extra-doc-files #8657
Conversation
bb20632
to
bd91b7f
Compare
bd91b7f
to
eb43ee0
Compare
It seems the OSX runner of CI locked up. I've taken the liberty of restarting failed jobs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this is a very useful check. As noted in my review, I think this should go in checkPackageFilesPreDistribution
, because once the .tar.gz
is made/uploaded, then it is too late.
Please tell me if what I say makes sense and whether I can help you in modifying the patch.
BTW, I've just found #8068. |
Somehow I missed it 😅. If I understand it well, it is also based on sjakobi’s work but does not modify There is also a comment of phadej to be addressed:
@phadej Would it be ok to display the warning for readmes only if there is no long description of the package, or if it is too short1? Footnotes
|
I agree with Herbert on the fact that these That's really a problem with EDIT: Also stack template omitted readmes from |
+100 to warn on missing changelogs. I can live without README, but changelogs are essential. |
@phadej I am not sure I follow you: I find
Also, in order to understand the context better, could you link or summarize which discussion with Herbert you refer to? |
(will repost here for better visibility) @wismill what is your current idea about this PR? Warning about “file is present in the working tree but not in If the latter, you can do it by a simple, pure check; the former would not be needed anymore, I think. |
|
I see, thanks. Let’s see if more people chime in. re: tests you can mass |
ca9f9e0
to
1da3835
Compare
description: See the readme on <https://github.com/haskell/cabal Github>. is useless. Proper descriptions (i.e. short abstracts describing the package) are great. |
@phadej OK then, we agree these descriptions are useless. So if I understand well, these kind of descriptions are generated by Now, there are two questions to consider:
I am addressing 1) in a further commit. |
You are really touching a very old s**t pile. The check for descriptions to be longer than synopsis is good enough and not annoying people. For the record, there are many people who turn e.g. |
OK then: should we:
I prefer 3 > 4 > 2 > 1 |
Check only globs, not the filesystem.
b085763
to
ce49487
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Brilliant. Please kindly set the label (I guess squash+merge_me) and this will give everybody 2 more days to re-review or otherwise comment.
thank you for the review; I presume the changes have been applied, so I'm taking the liberty to unblock merging
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add tests for cabal-version: 1.12
(i.e. which doesn't yet have extra-doc-files
) and adjust the check warnings accordingly.
*could you please |
I adjusted the code for Cabal <= 1.12 and I added label |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done
Some random net outage crashed CI, so I restarted affected tests. |
@mergify refresh |
✅ Pull request refreshed |
@wismill since the changelog-only version is merged, could you, perhaps, rename the PR and the corresponding issue, to reflect the actual change? |
@wismill: Thanks for this awesome new feature! I encountered this:
I think the file filter should exclude common backup file extensions. Ah, yes, and we should test for this. A single test containing lots of variants for files that should not be considered would suffice here. CC: @ffaf1 |
isDesirableExtraDocFile :: [FilePath] -> FilePath -> Bool | ||
isDesirableExtraDocFile paths path = map toLower basename `elem` paths | ||
where | ||
(basename, _ext) = splitExtension path |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extensions like .bak
, tmp
, .*~
, files ending in ~
etc. should be ruled out here.
Ideally, you would rule out anything in .gitignore
as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.swp, .swn, swo,...
Almost better to whitelist extensions (no extension, txt
, md
, rst
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also .markdown
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
“no extension“ should be whitelisted too, NEWS
is common in GNU programs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See: https://github.com/haskell/hackage-server/blob/master/src/Distribution/Server/Packages/ChangeLog.hs
I would also add rst. PR comming.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #8747
Am I correct this needs a backport to 3.10? |
I'd vote yes: I can't imagine this could backfire. (Although, my imagination is limited!) |
If I understand this right, our choice is to revert the original change or apply the fix. Keeping the change that we know has problems doesn't make sense to me. Actually, good that I asked, because I misplaced the comment. I meant to ask this about #8747. Unless I'm mixing everything up and the original change is not on branch 3.10? |
Fixes #3964.
Based on @sjakobi’s work.
MissingExpectedExtraDocFiles
.