Skip to content
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

Add list-sets command #5635

Merged
merged 1 commit into from Apr 24, 2021
Merged

Add list-sets command #5635

merged 1 commit into from Apr 24, 2021

Conversation

keradus
Copy link
Member

@keradus keradus commented Apr 18, 2021

closes #5621
example: php php-cs-fixer list-sets --format json

@@ -0,0 +1,31 @@
{
Copy link
Member Author

Choose a reason for hiding this comment

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

@MaXal , would that fit your needs?
// part one: schema

*/
protected function createSimpleReport()
{
return '{
Copy link
Member Author

Choose a reason for hiding this comment

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

@MaXal , would that fit your needs?
// part two: example json result

"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"sets": {
Copy link
Member Author

Choose a reason for hiding this comment

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

I was wondering about this special nesting level (let me call it "envelope") -> for now, we don't really need it.
Yet, we had cases in past, when Rule was expecting configuration like [foo, bar] and we couldn't extend it, causing a BC break to introduce {items => [foo, bar], otherOption: true}. let's be future ready

@coveralls
Copy link

coveralls commented Apr 18, 2021

Coverage Status

Coverage decreased (-0.04%) to 91.897% when pulling ddf9c0e on keradus:list-sets into ab5358e on FriendsOfPHP:master.

@kubawerlos
Copy link
Contributor

Why did the coverage dropped?

@keradus
Copy link
Member Author

keradus commented Apr 18, 2021

no clue

keradus added a commit that referenced this pull request Apr 19, 2021
This PR was squashed before being merged into the 2.18 branch.

Discussion
----------

Move fix reports (classes and schemas)

to follow approach from #5635

Commits
-------

552bf42 Move fix reports (classes and schemas)
@MaXal
Copy link

MaXal commented Apr 23, 2021

Thank you a lot for your work! The result works great! I choose to implement a parser based on txt format since it's much easier to parse.
image

@keradus
Copy link
Member Author

keradus commented Apr 24, 2021

Thanks for the feedback, @MaXal !
In that case, I gonna merge the PR as-is.

Please, be warned that for JSON, the result is well-specified and you can rely on schema under BC promise. For txt output, the format of message can be modified at any PHP CS Fixer update.

@keradus keradus merged commit 2cdaf47 into PHP-CS-Fixer:master Apr 24, 2021
@keradus keradus deleted the list-sets branch April 24, 2021 16:57
@MaXal
Copy link

MaXal commented Apr 26, 2021

@keradus Thank you! I will take a look at JSON format then to make the support more bullet-proof!

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.

None yet

4 participants