-
Notifications
You must be signed in to change notification settings - Fork 712
cabal check: Warn if changelogs are omitted from extra-doc-files #8657
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
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
e4fee32
cabal check: Warn if expected files are omitted from extra-doc-files
wismill eb43ee0
Add test
wismill cae69e1
Add missing files and their hackage’s reference
wismill 1da3835
Move doc file check from checkPackageContent to checkPackageFilesPreD…
wismill 5a80e36
Check based on globs only
wismill ce49487
Update test outputs
wismill 68fdf06
Make check more robust to relative paths
wismill 705f6bd
Fix tests failing with "Distribution quality warnings"
wismill 867e0af
Fix comments and changelog [skip ci]
wismill 9aacab5
Test changelog only if present
wismill 9ffeac5
Revert "Update test outputs"
wismill 6de7d3c
Revert "Fix tests failing with "Distribution quality warnings""
wismill 3cac225
Fix changelog
wismill 18c5a60
Remove getGlobFiles
wismill 4baf6ba
Adapt warnings to version 1.12
wismill c17daac
Merge branch 'master' into wip/check_readme
mergify[bot] dc8c265
Merge branch 'master' into wip/check_readme
mergify[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
...e/PackageTests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/NotExisting/cabal.out
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# cabal check | ||
No errors or warnings could be found in the package. |
7 changes: 7 additions & 0 deletions
7
...ckageTests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/NotExisting/cabal.test.hs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import Test.Cabal.Prelude | ||
|
||
import System.Directory (createDirectoryIfMissing) | ||
|
||
-- Omitting ChangeLog.md but not README in extra-doc-files | ||
main = cabalTest $ do | ||
cabal "check" [] |
12 changes: 12 additions & 0 deletions
12
...e/PackageTests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/NotExisting/pkg.cabal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
cabal-version: 3.0 | ||
name: pkg | ||
synopsis: synopsis | ||
description: description | ||
version: 0 | ||
category: example | ||
maintainer: none@example.com | ||
license: GPL-3.0-or-later | ||
|
||
library | ||
exposed-modules: Foo | ||
default-language: Haskell2010 |
Empty file.
Empty file.
3 changes: 3 additions & 0 deletions
3
...ageTests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/NotIncluded/V1.12/cabal.out
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# cabal check | ||
Warning: These warnings may cause trouble when distributing the package: | ||
Warning: Please consider including the file './ChangeLog.md' in the 'extra-source-files' section of the .cabal file if it contains useful information for users of the package. |
7 changes: 7 additions & 0 deletions
7
...ests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/NotIncluded/V1.12/cabal.test.hs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import Test.Cabal.Prelude | ||
|
||
import System.Directory (createDirectoryIfMissing) | ||
|
||
-- Omitting ChangeLog.md but not README in extra-doc-files | ||
main = cabalTest $ do | ||
cabal "check" [] |
14 changes: 14 additions & 0 deletions
14
...ageTests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/NotIncluded/V1.12/pkg.cabal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
cabal-version: 1.12 | ||
build-type: Simple | ||
name: pkg | ||
synopsis: synopsis | ||
description: description | ||
version: 0 | ||
category: example | ||
maintainer: none@example.com | ||
license: GPL-3 | ||
license-file: LICENSE | ||
|
||
library | ||
exposed-modules: Foo | ||
default-language: Haskell2010 |
Empty file.
3 changes: 3 additions & 0 deletions
3
...kageTests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/NotIncluded/V3.0/cabal.out
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# cabal check | ||
Warning: These warnings may cause trouble when distributing the package: | ||
Warning: Please consider including the file './ChangeLog.md' in the 'extra-doc-files' section of the .cabal file if it contains useful information for users of the package. |
7 changes: 7 additions & 0 deletions
7
...Tests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/NotIncluded/V3.0/cabal.test.hs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import Test.Cabal.Prelude | ||
|
||
import System.Directory (createDirectoryIfMissing) | ||
|
||
-- Omitting ChangeLog.md but not README in extra-doc-files | ||
main = cabalTest $ do | ||
cabal "check" [] |
12 changes: 12 additions & 0 deletions
12
...kageTests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/NotIncluded/V3.0/pkg.cabal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
cabal-version: 3.0 | ||
name: pkg | ||
synopsis: synopsis | ||
description: description | ||
version: 0 | ||
category: example | ||
maintainer: none@example.com | ||
license: GPL-3.0-or-later | ||
|
||
library | ||
exposed-modules: Foo | ||
default-language: Haskell2010 |
Empty file.
Empty file.
3 changes: 3 additions & 0 deletions
3
...kageTests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/WrongField/V1.12/cabal.out
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# cabal check | ||
Warning: These warnings may cause trouble when distributing the package: | ||
Warning: Please consider moving the file 'ChangeLog.md' from the 'data-files' section of the .cabal file to the section 'extra-source-files'. |
7 changes: 7 additions & 0 deletions
7
...Tests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/WrongField/V1.12/cabal.test.hs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import Test.Cabal.Prelude | ||
|
||
import System.Directory (createDirectoryIfMissing) | ||
|
||
-- Included ChangeLog.md but not in extra-doc-files | ||
main = cabalTest $ do | ||
cabal "check" [] |
15 changes: 15 additions & 0 deletions
15
...kageTests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/WrongField/V1.12/pkg.cabal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
cabal-version: 1.12 | ||
build-type: Simple | ||
name: pkg | ||
synopsis: synopsis | ||
description: description | ||
version: 0 | ||
category: example | ||
maintainer: none@example.com | ||
license: GPL-3 | ||
license-file: LICENSE | ||
data-files: ChangeLog.md | ||
|
||
library | ||
exposed-modules: Foo | ||
default-language: Haskell2010 |
Empty file.
3 changes: 3 additions & 0 deletions
3
...ckageTests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/WrongField/V3.0/cabal.out
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# cabal check | ||
Warning: These warnings may cause trouble when distributing the package: | ||
Warning: Please consider moving the file 'ChangeLog.md' from the 'extra-source-files' section of the .cabal file to the section 'extra-doc-files'. |
7 changes: 7 additions & 0 deletions
7
...eTests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/WrongField/V3.0/cabal.test.hs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import Test.Cabal.Prelude | ||
|
||
import System.Directory (createDirectoryIfMissing) | ||
|
||
-- Included ChangeLog.md but not in extra-doc-files | ||
main = cabalTest $ do | ||
cabal "check" [] |
13 changes: 13 additions & 0 deletions
13
...ckageTests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/WrongField/V3.0/pkg.cabal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
cabal-version: 3.0 | ||
name: pkg | ||
synopsis: synopsis | ||
description: description | ||
version: 0 | ||
category: example | ||
maintainer: none@example.com | ||
license: GPL-3.0-or-later | ||
extra-source-files: ChangeLog.md | ||
|
||
library | ||
exposed-modules: Foo | ||
default-language: Haskell2010 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
synopsis: Warn if expected files are omitted from extra-doc-files | ||
packages: Cabal | ||
prs: #8657 | ||
issues: #3964 | ||
|
||
description: { | ||
|
||
- Emit a warning if there exist a “changelog” file at the root of the | ||
package which is not included in any field. | ||
- Emit a warning if a “changelog” file at the root of the package is included | ||
in a field different from “extra-doc-files” (Cabal spec >= 1.18) or | ||
“extra-source-files” (spec < 1.18). | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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