check-manifest icon indicating copy to clipboard operation
check-manifest copied to clipboard

Warn if manifest has lines that don't do anything

Open cjerdonek opened this issue 9 years ago • 10 comments

It would be nice if check-manifest also warned you if MANIFEST.in has lines that "don't do anything" (i.e. lines that match no files being included). The presence of such lines means that MANIFEST.in can be simplified, or perhaps that files are missing from source control that should be there.

cjerdonek avatar Oct 01 '14 12:10 cjerdonek

I'd accept such a pull request. I'm unlikely to find time to work on this myself.

mgedmin avatar Oct 01 '14 13:10 mgedmin

It looks like one prerequisite to doing this is enhancing _get_ignore_from_manifest() to return the include lines and not just the exclude lines. Once that is in place, it should be straightforward.

The suggestions in this feature request can note not just unneeded includes but also unneeded excludes.

cjerdonek avatar Oct 01 '14 14:10 cjerdonek

Unneeded excludes tend to produce warnings during pip install time, so warning about them seems like a good idea.

I'm waiting for the pull request :)

mgedmin avatar Oct 01 '14 15:10 mgedmin

I started working on it to see how much time it would take. :)

I will see if I have some time later this week, but not today.

cjerdonek avatar Oct 01 '14 15:10 cjerdonek

This is complicated by the fact that a line like prune docs/_build might appear not to be doing anything if you don't have a docs/_build directory at the moment (like after a clean checkout), but it will be doing something important if you happen to run make -C docs html and build your Sphinx documentation.

mgedmin avatar Dec 23 '14 07:12 mgedmin

That seems acceptable to me given that the proposal is for a warning rather than an error. For example, if there is a warning that docs/_build doesn't exist, I think the user could surmise that the documents haven't been built.

cjerdonek avatar Dec 23 '14 08:12 cjerdonek

BTW I would be very interested in seeing concrete examples of situations where you missed such warnings!

mgedmin avatar Dec 23 '14 08:12 mgedmin

I'll let you know if I encounter any in the future. It's been a while since I filed this, so I can't remember the particular files unfortunately.

cjerdonek avatar Dec 23 '14 08:12 cjerdonek

I have a concrete example.

Upon refactoring linters' configuration for the Resolwe project, the .pep8rc file was deleted, however, it remained in the MANIFEST.in file as include .pep8rc .pylintrc tox.ini on line 9.

As mentioned in this issue report, this remained uncaught by the check-manifest tool so it remained unnoticed until a developer spotted it and removed it.

tjanez avatar Oct 27 '16 08:10 tjanez

Thank you, that is a useful example.

mgedmin avatar Oct 27 '16 08:10 mgedmin