jorisroovers / gitlint

Linting for your git commit messages
http://jorisroovers.github.io/gitlint
MIT License
791 stars 99 forks source link

Fix msg-filename kept open after edition #491

Closed jorisroovers closed 1 year ago

jorisroovers commented 1 year ago

--msg-filename type is now a Path and not a managed click.File. This makes it easier to control the opening and closing of the file.

Context manager will make sure that the file we use will be refreshed after edition.

coveralls commented 1 year ago

Coverage Status

Coverage: 99.661% (-8.0e-05%) from 99.662% when pulling 47948a18718e4a2ae968aa5269d376847a959ae7 on issue-180 into 2a48cdadad2e0085ac3e66cfc2b498e0dbdc9519 on main.

jorisroovers commented 1 year ago

Original PR in #182. This PR is the same change re-implemented on top of latest main, this avoided more complex rebasing of #182 and a force push (losing the existing commit in the PR).

I ended up removing the test because I don’t think it actually tested correctly.

What we really need here is an integration test, since it seems to be OS-level behavior that’s causing the issue. However, it might be OS specific - I’ve not been able to reproduce this issue. This complicates coming up with a good integration test. Existing integration tests passing indicate there’s no major regression with gitlint itself - I think that’s good enough for now.