codespell-project / actions-codespell

MIT License
74 stars 19 forks source link

Fix line annotation numbers during out of sync PRs #13

Open peternewman opened 4 years ago

peternewman commented 4 years ago

I don't know why this is being annotated at line 289 rather than 269, any ideas @larsoner ? It has the right number when I use git master on the raw file: https://github.com/codespell-project/codespell/runs/758602736?check_suite_focus=true#step:4:13

It's another false positive apostrophe thing though, see e.g. #651

_Originally posted by @peternewman in https://github.com/_render_node/MDExOlB1bGxSZXF1ZXN0Mzg2NzcwNTUx/pull_requests/unread_timeline_

peternewman commented 4 years ago

Okay it's because @waldyrious branch is out of date, most obviously here: https://github.com/codespell-project/codespell/blob/c41689dc6d5d66775dbd1d49703cbfc3e9f17b09/codespell_lib/_codespell.py#L34-L39

I think this might do the trick, but we'd need to vary it depending on if it's a PR or a branch run. https://github.com/actions/checkout#Checkout-pull-request-HEAD-commit-instead-of-merge-commit

The option to ensure PRs are in sync with master would probably also remove this challenge...

_Originally posted by @peternewman in https://github.com/_render_node/MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDQzODQxMzIwMA==/comments/review_comment_