Skip to content

Better Ansi Output #898

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
5 tasks done
Kazuto opened this issue Jun 10, 2021 · 6 comments · Fixed by #902
Closed
5 tasks done

Better Ansi Output #898

Kazuto opened this issue Jun 10, 2021 · 6 comments · Fixed by #902
Assignees
Labels
Enhancement Good first issue If you want to help, this may be a good start

Comments

@Kazuto
Copy link

Kazuto commented Jun 10, 2021

Description

We've just started using phpmd in an already established codebase and the ANSI output was just confusing to read or to understand what belongs to what.

It's unclear for users who took the first look at the output that it's divided like

File:
-----
Findings

But instead of being read as

-----
Findings
File:
-----

Adding a blank like certainly would make the output more readable and easier on the eyes, like this:

Before After
Screenshot 2021-06-10 at 11 36 14 AM Screenshot 2021-06-10 at 11 43 26 AM

I have not looked into the codebase to say if I could provide a PR.

Checks before submitting

  • Be sure that there isn't already an issue about this. See: Issues list
  • Be sure that there isn't already a pull request about this. See: Pull requests
  • Tell if you have the option to provide the code for this proposal.
  • This issue is about 1 feature proposal and nothing more.
  • The issue has a descriptive title. For example: "Add JSON render option".
@kylekatarnls kylekatarnls added Enhancement Good first issue If you want to help, this may be a good start labels Jun 10, 2021
@kylekatarnls
Copy link
Member

Sounds fair to me.

@himanshu007-creator
Copy link
Contributor

Hi, i would like to work on this issue. Please point me the file. Thanks

@tvbeek
Copy link
Member

tvbeek commented Jun 10, 2021

De different renders are place in src/main/php/PHPMD/Renderer so the Ansi renderer is: https://github.com/phpmd/phpmd/blob/master/src/main/php/PHPMD/Renderer/AnsiRenderer.php

To test for that renders is placed in: https://github.com/phpmd/phpmd/blob/master/src/test/php/PHPMD/Renderer/AnsiRendererTest.php

Because you say that you want to work on this issue I assign it to you so that it is clear for everyone. (And thanks that you want to help 👍 )

Please say it if you want to have more information 😃

@himanshu007-creator
Copy link
Contributor

Can you tell where exactly to insert the new line? I am new to PHP

@kylekatarnls
Copy link
Member

This line writes the file header to the output:
https://github.com/phpmd/phpmd/blob/master/src/main/php/PHPMD/Renderer/AnsiRenderer.php#L41

@kylekatarnls
Copy link
Member

Hello @Kazuto, thanks to @himanshu007-creator there is now one more new line in between, you can test it requiring "phpmd/phpmd": "dev-master"

@ravage84 ravage84 added this to the 2.x (unspecific) milestone May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Good first issue If you want to help, this may be a good start
Development

Successfully merging a pull request may close this issue.

5 participants