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
Add pre-commit check for MANIFEST membership #1084
Conversation
I was considering making this a GitHub PR bot, but realized the "change suggestions" flow isn't that pleasant, at best the bot can leave a comment, and that's already too late and inconvenient. Since I have the pre-commit hook always on when committing nowadays, adding the manifest check in there is very natural for the dev flow, and saves the public embarrassment aspect of it all :> |
88af370
to
cd6006f
Compare
Might be worth running this check as part of Travis too, if for whatever reason the pre-commit hook doesn't run. That would have made me fix it in #1078. |
Oh, that's a curious idea. I could move it under Util::Test and add a simple test entry for the check. |
337998a
to
d015e75
Compare
Funny story - adding a manifest test actually revealed files missing from the MANIFEST. I used a standard Perl method in the test, so the SKIP file is respected. I also updated the pre-commit hook to always run the manifest check, so we're doubly safe. |
\.test.status$ | ||
\.fls$ | ||
\.synctex\.gz$ | ||
\.fdb_latexmk$ |
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.
added some exclusions I needed for my local setup, bunch of aux files.
@brucemiller if you merge this PR next, I can quickly run through all my other open PRs and ensure new files are properly added to the manifest. Cool incentive? :> |
Hmm...tempting offer! But I'm wondering; shouldn't this be more whitelist than blacklist? Ie. except for a few top-level files, only files in |
@brucemiller you'd have to take that particular point up with the ExtUtils developers. I relied on the mature tooling of I could switch to a whitelist, but then I think I would have to rely on my own code to post-filter the results of Example: we add a new directory, "extended_tests" at the root level of LaTeXML, that are only ran with a special flag. If I had a whitelist approach, it would never notice it isn't in the manifest. The current PR would alert you that you should add it to the manifest or skip it explicitly. And then one could ask themselves the question whether the extended tests belong in the distribution or not, and so forth... |
Indeed, the exclusions are already covered in SKIP. Thanks!!! |
Hmm... this makes sense as a pre-commit hook, if it's checking committed files. But I'm having second thoughts about being part of make test: it's pretty radical if you have any scratch work lying around. |
@brucemiller it is indeed very strict, but only as long as you haven't added your scratch examples to SKIP. If you're at a point of running |
Another thing to keep in mind is that you may avoid this entirely by using a more precise (and faster) make test invocation. For instance, if you're only extending grammar coverage, you could run:
|
As Dirk Gently says: Everything is Connected. So, I always run a full make test before I commit, branch or not. And having to maintain SKIP over local, temporary changes seems more obtrusive to being obliged to maintain MANIFEST over intentional, permanent ones, no? |
@brucemiller I understand it looks obtrusive, especially if you already have a lot of scratch files at the local checkout. Or if you end up moving the same file several times and you need to rename it in the manifest each time. That said, those ought to be rare events for most branches, so I am personally OK with having the extra strictness. If you hate it, feel free to remove it. I recall the main reason I loved the idea of having a standalone test is that Travis-CI (and now Appveyor) will fail if we forget to update the manifest. So even if you do both of:
You still won't trick the maintainer, because Travis will immediately go red and complain. I have pushed "small changes" with --no-verify, and not testing in my life, though I would claim a long time ago when I was young and careless, but I'd rather trust a machine to double-check any PR open for latexml. |
Indeed, the real main use case is that if a brand new contributor shows up and files a new pull request for their new binding, Travis will educate them about our manifest issues, and you don't have to double-check the pull request every time. |
OK, double-checked, both Travis and Appveyor set environmental variables, notably |
Hmmm... let me see how cleanupable skip (and development habits) are... |
Since I'd still like to do things like add files & testcases and run make test before committing, I'm still likely to accept the other PR. But in the interest of general hygiene, it seemed like a good time to cleanup things, and improve So, does the pre-commit hook actually use the skip file? I don't see it, and it's complaining about committing |
The pre-commit hook doesn't use the SKIP file in master, and I am oddly confused where my change to it disappeared into. I recall updating it at a later point, when I discovered |
A bit saner now, here is the commit (in the open PR) 77155b0 |
Example effect, when adding a new binding and forgetting to update the MANIFEST:
Hopefully can make the @brucemiller 's reviewer life a little more pleasant!