Skip to content

feat: group logs based on file when using gh formatter - #2094

Merged
azu merged 16 commits into
textlint:masterfrom
thompson-tomo:patch-1
Aug 1, 2026
Merged

azu merged 16 commits into
textlint:masterfrom
thompson-tomo:patch-1

Conversation

@thompson-tomo

@thompson-tomo thompson-tomo commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

This groups the logs based on file just like the stylish formatter. This is so that when using the github format you can see what the messages refer to without needing to check annotation.

The current scenario is
image

devin-ai-integration[bot]

This comment was marked as resolved.

@azu

azu commented Jul 24, 2026

Copy link
Copy Markdown
Member

Where can I find a reference for this format?

devin-ai-integration[bot]

This comment was marked as resolved.

@thompson-tomo

thompson-tomo commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor Author

@azu this is logging the file context as plain text so u can see it in the gh logs.

The content going in annotations is defined in https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-commands#setting-a-warning-message

devin-ai-integration[bot]

This comment was marked as resolved.

@thompson-tomo thompson-tomo changed the title feat: log file context using standard formatter feat: log file context using plaintext in gh formatter Jul 24, 2026
@thompson-tomo

Copy link
Copy Markdown
Contributor Author

@azu can u take a look at this please. See open-telemetry/semantic-conventions#3928 as an example of what prompted this usability improvement. Key thing is if the log line starts with :: it triggers handling as an annotation otherwise handles it as an ordinary log line.

@azu

azu commented Jul 26, 2026

Copy link
Copy Markdown
Member

Thanks, I understand the motivation.
However, the problem is that this is a proprietary format, which is a concern for me.

There are similar reports in Ruff #1693 and Oxlint #20492.

Ruff considered separate plaintext lines, but ultimately included the location in the annotation message itself(Ruff #1696).
Oxlint proposed the same approach in oxc-project/oxc#20499, although that PR was not merged.

For that reason, I would prefer not to add a separate, foo.js: line=5, col=10 line. If we want to work around the GitHub log display limitation, could we include foo.js:5:10 in the annotation message body instead?

::error file=foo.js,line=5,col=10,...,title=foo.js:5:10 Unexpected foo.

Essentially, I think this is a problem that GitHub should fix.
If you're looking for a workaround, I think it's better to include it in the message body, even if it doesn't look as good, because the amount of information will be the same for both the CI log and the annotation, ensuring consistency.

@thompson-tomo

thompson-tomo commented Jul 26, 2026 •

Copy link
Copy Markdown
Contributor Author

It seems like there is no consensus on how best to do it, as some widely popular tools ie cspell duplicate the entire log once in standard log format & once in gh format, some group them based on file ie yamlint, some duplicate info into the body ie mdling.

Would it be fine to follow the grouping solution as we already do in the stylish formatter? That seems the nicest option as it even improves usability as the messages can be collapsed per file.

devin-ai-integration[bot]

This comment was marked as resolved.

thompson-tomo and others added 2 commits July 27, 2026 01:38
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Comment on lines +57 to +58
output += ` @ L${message.loc.start.line || 1}`;
output += `C${message.loc.start.column || 1}`;

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.

I think <filepath>:<line number>:<column> is better.
For example, browser stack traces and web technologies like VSCode often use this format.

<filepath>:<line number>:<column>: <message>

or

<message> @ <filepath>:<line number>:<column>

Since the location information is displayed in a different location when there are multiple lines, I think the following format, similar to Ruff, would be better.

<filepath>:<line number>:<column>: <message>

@thompson-tomo thompson-tomo Jul 27, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Filepath is un-necessary as it is the name of the group and this follows the structure of the stylish formatter. These groups provide indentation and even enable collapsible groups of logs hence improves usability.

The location ie L{{x}}C{{x}} is the github format used see https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-a-permanent-link-to-a-code-snippet and also what u get when you share a code reference.

@thompson-tomo thompson-tomo Jul 29, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Also note in pretty view, the user will have a list of files with issues and clicking one shows the issues in that file directly under the heading they clicked. Hence this is a great bonus for a user.

@azu azu Aug 1, 2026 •

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.

The location ie L{{x}}C{{x}} is the github format used see https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-a-permanent-link-to-a-code-snippet and also what u get when you share a code reference.

Hmm, I think it would be fine if it were an actual URL like <url>#L{{x}}C{{x}}.
However, I thought this would just display the string L{{x}}C{{x}}, but am I wrong?
I don't see much value in it because I feel like users would need to understand the meaning of 'L' and 'C'.

Also note in pretty view, the user will have a list of files with issues and clicking one shows the issues in that file directly under the heading they clicked. Hence this is a great bonus for a user.

Do you have a screenshot?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It would be just like yamllint, see an interactive example at https://github.com/open-telemetry/semantic-conventions/actions/runs/29971521674/job/89094348620?pr=3919

With the logs being

2026-07-23T01:20:10.7416825Z ##[group]./.chloggen/3919.yaml
2026-07-23T01:20:10.7419399Z ##[error]5:1 [empty-lines] too many blank lines (1 > 0)
2026-07-23T01:20:10.7420484Z ##[endgroup]

@azu azu Aug 1, 2026 •

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.

thank you,
The format of yamllint looks good.
How about using the same format?
What I find questionable is the use of the unusual format L<line>C<column> as a string to display.

##[group]<path>
##[error]<line>:<column> [<ruleid>] <message>
##[endgroup]

@thompson-tomo thompson-tomo Aug 1, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I have just added the semicolon between line and column so it is now L<line>:C<column> that way reader has context what it relates to. If you just had 9:40, you could mistake it for a time.

Is that ok, other option would be Location = <line>:<column> but i suspect that is too verbose

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.

image

The context of a file is clear, so I don't think anyone would mistake this for time.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's not that clear when you are skim reading things as you are in rush or you have been going at it for a very long time. Anyway i have made the change as even with the ambiguity is still an improvement to what we have now.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

@thompson-tomo thompson-tomo changed the title feat: log file context using plaintext in gh formatter feat: group logs file context using plaintext in gh formatter Jul 27, 2026
@thompson-tomo thompson-tomo changed the title feat: group logs file context using plaintext in gh formatter feat: group logs based on file when using gh formatter Jul 27, 2026
@thompson-tomo

Copy link
Copy Markdown
Contributor Author

@azu just following up now that i shared additional reasoning why the filename is un-necessary in the body.

@azu azu 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.

lgtm

@azu
azu merged commit 101cba6 into textlint:master Aug 1, 2026
13 checks passed
@github-actions github-actions Bot mentioned this pull request Aug 1, 2026
azu added a commit that referenced this pull request Aug 1, 2026
<!-- Release notes generated using configuration in .github/release.yml
at master -->

## What's Changed
### Feature
* Upgrade textlint MCP server to SDK v2 by @azu in
#2102
* feat: group logs based on file when using gh formatter by
@thompson-tomo in #2094
### Documentation
* docs: update package URL by @314systems in
#2061
### Refactoring
* refactor: replace chalk with Node.js built-in styleText() by
@Bhavysinghal in #2079
* refactor(ast-node-types): simplify TypeofTxtNode with a lookup map by
@314systems in #2078
### CI
* CI: Upgrade automerge-gate action to v5.0.0 by @azu in
#2048
* chore(deps): update peaceiris/actions-gh-pages action to v4.1.0 by
@renovate[bot] in #2049
* chore(deps): update github/codeql-action action to v3.35.5 by
@renovate[bot] in #2053
* chore(deps): update github/codeql-action action to v3.36.0 by
@renovate[bot] in #2058
* chore(deps): update patch updates to v3.36.1 by @renovate[bot] in
#2069
* chore(deps): update patch updates to v3.36.2 by @renovate[bot] in
#2070
* chore(deps): update github/codeql-action action to v3.36.3 by
@renovate[bot] in #2086
* chore(deps): update github/codeql-action action to v3.37.0 by
@renovate[bot] in #2090
* chore(deps): update github/codeql-action action to v3.37.1 by
@renovate[bot] in #2093
* chore(deps): update minor updates by @renovate[bot] in
#2097
* chore(deps): update github/codeql-action action to v3.37.2 by
@renovate[bot] in #2098
* chore(deps): update github/codeql-action action to v3.37.3 by
@renovate[bot] in #2099
### Dependency Updates
* chore(deps): update dependency oxlint-tsgolint to ^0.23.0 by
@renovate[bot] in #2051
* chore(deps): update dependency @types/react to ^18.3.29 by
@renovate[bot] in #2054
* chore(deps): update dependency mocha to ^11.7.6 by @renovate[bot] in
#2055
* chore(deps): update babel monorepo to ^7.29.7 by @renovate[bot] in
#2056
* chore(deps): update babel monorepo to ^7.29.7 by @renovate[bot] in
#2057
* chore(deps): update pnpm to v10.34.0 by @renovate[bot] in
#2059
* chore(deps): update pnpm to v10.34.1 by @renovate[bot] in
#2060
* chore(deps): update minor updates to ^4.2.0 by @renovate[bot] in
#2063
* chore(deps): update vitest monorepo to ^3.2.6 by @renovate[bot] in
#2064
* chore(deps): update react monorepo (patch) by @renovate[bot] in
#2065
* chore(deps): update minor updates to ^24.13.0 by @renovate[bot] in
#2066
* chore(deps): update react monorepo to ^18.3.31 by @renovate[bot] in
#2067
* chore(deps): update patch updates to ^24.13.1 by @renovate[bot] in
#2068
* chore(deps): update patch updates (patch) by @renovate[bot] in
#2072
* chore(deps): update patch updates to v10.34.4 by @renovate[bot] in
#2074
* chore(deps): update dependency js-yaml to ^4.3.0 by @renovate[bot] in
#2080
* chore(deps): update dependency oxlint-tsgolint to ^0.24.0 by
@renovate[bot] in #2083
* chore(deps): update dependency vitest to ^3.2.7 by @renovate[bot] in
#2085
* chore(deps): update dependency @types/node to ^24.13.3 by
@renovate[bot] in #2087
* chore(deps): update pnpm to v10.34.5 by @renovate[bot] in
#2088
* chore(deps): update docusaurus monorepo to ^3.10.2 by @renovate[bot]
in #2089
* chore(deps): update dependency oxlint-tsgolint to ^0.25.0 by
@renovate[bot] in #2092
* chore(deps): update react monorepo to ^19.2.8 by @renovate[bot] in
#2095
* chore(deps): update dependency @modelcontextprotocol/sdk to ^1.30.0 by
@renovate[bot] in #2100

## New Contributors
* @Bhavysinghal made their first contribution in
#2079

**Full Changelog**:
v15.7.1...v15.8.0

Co-authored-by: azu <azu@users.noreply.github.com>
@thompson-tomo
thompson-tomo deleted the patch-1 branch August 1, 2026 04:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants