8000 Add Github annotations support to all linters · Issue #39122 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Add Github annotations support to all linters #39122

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

Closed
2 tasks done
ogizanagi opened this issue Nov 20, 2020 · 6 comments · Fixed by #39826 or #39828
Closed
2 tasks done

Add Github annotations support to all linters #39122

ogizanagi opened this issue Nov 20, 2020 · 6 comments · Fixed by #39826 or #39828
Labels
Good first issue Ideal for your first contribution! (some Symfony experience may be required) Help wanted Issues and PRs which are looking for volunteers to complete them.

Comments

@ogizanagi
Copy link
Contributor
ogizanagi commented Nov 20, 2020

Description

Based on #38982, we can now iterate and add Github annotations support to all the remaining linters provided by Symfony:

Additionally, the lint:twig and lint:xliff commands are not provided as a standalone binary as the Yaml component does. Would it be worth adding these?

Example

See #38982

@ogizanagi ogizanagi added Good first issue Ideal for your first contribution! (some Symfony experience may be required) Help wanted Issues and PRs which are looking for volunteers to complete them. labels Nov 20, 2020
@stof
Copy link
Member
stof commented Nov 20, 2020

lint:twig requires the configured Twig\Environment. that's why it does not have a standalone CLI.

@stof
Copy link
Member
stof commented Nov 20, 2020

For lint:container, I agree it might not make sense to have it. but other commands are definitely good ideas.

@YaFou
Copy link
Contributor
YaFou commented Jan 14, 2021

I added the support for Github Actions annotations with the lint:twig and lint:xliff command in the following pull requests: #39826 and #39828. Reviews are welcomed!

@carsonbot
Copy link

Thank you for this issue.
There has not been a lot of activity here for a while. Has this been resolved?

@ogizanagi
Copy link
Contributor Author

PRs are pending for reviews. Not resolved yet.

@carsonbot carsonbot removed the Stalled label Jul 15, 2021
@fabpot fabpot closed this as completed in b8d7e1f Jul 25, 2021
fabpot added a commit that referenced this issue Jul 25, 2021
… annotations (YaFou)

This PR was merged into the 5.4 branch.

Discussion
----------

[Translation] XliffLintCommand supports Github Actions annotations

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | Fix #39122 (for `lint:xliff`)
| License       | MIT
| Doc PR        | TODO
<!--
Replace this notice by a short README for your feature/bugfix. This will help people
understand your PR and can be used as a start for the documentation.

Additionally (see https://symfony.com/releases):
 - Always add tests and ensure they pass.
 - Never break backward compatibility (see https://symfony.com/bc).
 - Bug fixes must be submitted against the lowest maintained branch where they apply
   (lowest branches are regularly merged to upper ones so they get the fixes too.)
 - Features and deprecations must be submitted against branch 5.x.
-->

Adds a format to the XLIFF linter command to print Github Actions annotations when an error occurred ([documentation](https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-an-error-message)). There is a new format: `github` and the command will detect automatically the format to use in comparison with the environment.

> See a workflow example: https://github.com/YaFou/symfony-39828/actions/runs/485142330

---

TODO:
- [x] Test with a real project

Commits
-------

8ac2b2a [Translation] XliffLintCommand supports Github Actions annotations
@ruudk
Copy link
Contributor
ruudk commented Dec 1, 2021

lint:container: This one may not benefit a lot from it, as we don't have file & line info to show. Only the first error message would be shown.

FWIW, I was just looking into this. I would solve this by assigning the error to the src/Kernel.php as it originates from there and without a line number (optional, otherwise 1).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good first issue Ideal for your first contribution! (some Symfony experience may be required) Help wanted Issues and PRs which are looking for volunteers to complete them.
Projects
None yet
5 participants
0