Skip to content

ci: add GitHub annotations for Japanese textlint findings - #14778

Merged
morinokami merged 2 commits into
withastro:mainfrom
Yusaku01:ci/textlint-github-annotations-upstream
Oct 27, 2026
Merged

morinokami merged 2 commits into
withastro:mainfrom
Yusaku01:ci/textlint-github-annotations-upstream

Conversation

@Yusaku01

Copy link
Copy Markdown
Contributor

Description (required)

Purpose

The Japanese lint workflow currently reports findings in job logs and emits a generic failure annotation. Show each finding at the relevant line in the pull request so contributors can locate it without searching the logs.

With the GitHub formatter, printing the saved log again would emit each annotation command twice. Removing that reporting step avoids this repetition.

Why textlint 15.8.0?

The GitHub formatter was introduced in v15.5.0. v15.8.0 also adds per-file log groups, so this version provides both inline annotations and grouped CI logs.

Verification
  • All 148 Japanese MDX files pass with both 14.7.2 and 15.8.0, with caching disabled. A test violation retains the same rule, location, and suggested fix.
  • Draft demonstration PR uses the same workflow and dependency versions with one intentional violation. It shows one inline annotation, and the CI log confirms exit status 1 and one local-command hint. A passing fork run passed with the same lint command.
  • Local checks with both formatters produce the same finding and exit status. The failure handler preserves exit statuses 0/1/2.
GitHub pull request diff showing a textlint annotation below an intentional spacing violation on line 26

Screenshot from earlier fork verification; the demonstration PR above keeps a live example available.

One CLI behavior change is relevant: when the target pattern matches zero files, local checks returned 0 with 14.7.2 and 2 with 15.8.0. Failing in this case exposes missing lint coverage; the current documentation glob succeeds.

CI timing

Two earlier fork runs per version used the same input, including one intentional violation, and had no pnpm cache hits. GitHub's whole-second timings exclude queue time.

Measurement 14.7.2 15.8.0 + GitHub formatter
Japanese lint job 23s, 27s 27s, 24s
textlint step 2s, 2s 2s, 1s

No substantial increase appeared in this small sample. These measurements precede restoration of the local-command hint.

Sources: baseline attempts, updated PR run, updated manual run.

References

@Yusaku01 Yusaku01 changed the title ci: annotate Japanese textlint findings ci: add GitHub annotations for Japanese textlint findings Oct 24, 2026
@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Preview deployment

✅ Deployment complete!

@Yusaku01
Yusaku01 marked this pull request as ready for review October 24, 2026 05:37
@Yusaku01 Yusaku01 changed the title ci: add GitHub annotations for Japanese textlint findings ci(ja): add GitHub annotations for Japanese textlint findings Oct 25, 2026
@Yusaku01 Yusaku01 changed the title ci(ja): add GitHub annotations for Japanese textlint findings ci: add GitHub annotations for Japanese textlint findings Oct 25, 2026

@ArmandPhilippot ArmandPhilippot left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, the changes make sense to me! However, we have some conflicts (probably because of #14782), and we have another ongoing PR updating deps (#14784) so we might end up with new conflicts. 😅

I'm pinging @morinokami to ensure this is what Japanese translators want, as textlint is a bit unusual in our translation process. And also to let him know he can merge this if the conflicts are resolved and I'm not around at that time! No need to wait! ✔️

@Yusaku01

Yusaku01 commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks, the changes make sense to me! However, we have some conflicts (probably because of #14782), and we have another ongoing PR updating deps (#14784) so we might end up with new conflicts. 😅

I'm pinging @morinokami to ensure this is what Japanese translators want, as textlint is a bit unusual in our translation process. And also to let him know he can merge this if the conflicts are resolved and I'm not around at that time! No need to wait! ✔️

@ArmandPhilippot
Thank you for checking!! I've resolved the current conflicts for now!
I'll just wait and see how it goes. 🙏

@morinokami morinokami left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ArmandPhilippot Thanks for the ping! I like this change, as it makes it much easier to spot problematic lines at a glance instead of digging through CI logs. (Maybe we could do the same for broken links detected by CI?)

@Yusaku01 Thanks for your contribution! LGTM!!

@morinokami
morinokami merged commit a41acb5 into withastro:main Oct 27, 2026
9 checks passed
@ArmandPhilippot

Copy link
Copy Markdown
Member

Thanks, Shinya!

Maybe we could do the same for broken links detected by CI?

Isn't that already the case? I can see the same kind of annotations in https://github.com/withastro/docs/pull/14452/changes#diff-64bc37c347d5fd63b00742ef646432bfe2bada3efd75618bfe7f7a384bc9b41f

The issue, I suppose, is when errors occur in an unchanged file? I'm not sure how we could improve that but, yeah, a more friendly way to discover them would be helpful. I'll try to explore ideas!

@morinokami

Copy link
Copy Markdown
Member

@ArmandPhilippot

Isn't that already the case?

Haha, you're absolutely right! I've been looking at the logs this whole time and somehow missed that 😅 Thanks for pointing that out, and for looking into possible improvements!

@Yusaku01

Copy link
Copy Markdown
Contributor Author

@ArmandPhilippot @morinokami

Thank you both for reviewing and merging!
I thought it would be better if it were easier to read, as long as the CI time and the actual generated logs remained the same, so this was really helpful!😌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants