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

introduce table output formatter #337

Merged
merged 8 commits into from
Oct 19, 2020
Merged

Conversation

smoench
Copy link
Contributor

@smoench smoench commented Jul 24, 2020

resolves #326

$ php deptrac.php analyse examples/DirectoryLayer.depfile.yaml --formatter-console=0 --formatter-table=1 --formatter-table-report-uncovered=1
 5/5 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

 ----------- --------------------------------------------------------------------------------------------------------
  Reason      Controller
 ----------- --------------------------------------------------------------------------------------------------------
  Violation   examples\Layer1\AnotherClassLikeAController must not depend on examples\Layer2\SomeOtherClass (Layer2)
              /Users/simon/Projects/sensiolabs-de/deptrac/examples/Layer1/AnotherClassLikeAController.php:5
  Violation   examples\Layer1\AnotherClassLikeAController must not depend on examples\Layer2\SomeOtherClass (Layer2)
              /Users/simon/Projects/sensiolabs-de/deptrac/examples/Layer1/AnotherClassLikeAController.php:14
  Violation   examples\Layer1\AnotherClassLikeAController must not depend on examples\Layer2\SomeOtherClass (Layer2)
              /Users/simon/Projects/sensiolabs-de/deptrac/examples/Layer1/AnotherClassLikeAController.php:23
  Violation   examples\Layer1\AnotherClassLikeAController must not depend on examples\Layer2\SomeOtherClass (Layer2)
              /Users/simon/Projects/sensiolabs-de/deptrac/examples/Layer1/AnotherClassLikeAController.php:19
 ----------- --------------------------------------------------------------------------------------------------------

 ----------- ------------------------------------------------------------------------------
  Reason      Layer1
 ----------- ------------------------------------------------------------------------------
  Uncovered   examples\Layer1\SomeClass has uncovered dependency on Uncovered\Dependency
              /Users/simon/Projects/sensiolabs-de/deptrac/examples/Layer1/SomeClass.php:14
 ----------- ------------------------------------------------------------------------------

 ----------- ----------------------------------------------------------------------------------------
  Reason      Layer2
 ----------- ----------------------------------------------------------------------------------------
  Violation   examples\Layer2\SomeOtherClass2 must not depend on examples\Layer1\SomeClass2 (Layer1)
              /Users/simon/Projects/sensiolabs-de/deptrac/examples/Layer2/SomeOtherClass2.php:5
  Violation   examples\Layer2\SomeOtherClass2 must not depend on examples\Layer1\SomeClass2 (Layer1)
              /Users/simon/Projects/sensiolabs-de/deptrac/examples/Layer2/SomeOtherClass2.php:9
  Violation   examples\Layer2\SomeOtherClass2 must not depend on examples\Layer1\SomeClass2 (Layer1)
              /Users/simon/Projects/sensiolabs-de/deptrac/examples/Layer2/SomeOtherClass2.php:17
  Violation   examples\Layer2\SomeOtherClass2 must not depend on examples\Layer1\SomeClass2 (Layer1)
              /Users/simon/Projects/sensiolabs-de/deptrac/examples/Layer2/SomeOtherClass2.php:14
  Skipped     examples\Layer2\SomeOtherClass must not depend on examples\Layer1\SomeClass (Layer1)
              /Users/simon/Projects/sensiolabs-de/deptrac/examples/Layer2/SomeOtherClass.php:5
  Skipped     examples\Layer2\SomeOtherClass must not depend on examples\Layer1\SomeClass (Layer1)
              /Users/simon/Projects/sensiolabs-de/deptrac/examples/Layer2/SomeOtherClass.php:9
  Skipped     examples\Layer2\SomeOtherClass must not depend on examples\Layer1\SomeClass (Layer1)
              /Users/simon/Projects/sensiolabs-de/deptrac/examples/Layer2/SomeOtherClass.php:17
  Skipped     examples\Layer2\SomeOtherClass must not depend on examples\Layer1\SomeClass (Layer1)
              /Users/simon/Projects/sensiolabs-de/deptrac/examples/Layer2/SomeOtherClass.php:14
 ----------- ----------------------------------------------------------------------------------------


 -------------------- -----
  Report
 -------------------- -----
  Violations           8
  Skipped violations   4
  Uncovered            1
  Allowed              15
 -------------------- -----

@smoench smoench added this to the 0.9 milestone Jul 24, 2020
@smoench smoench self-assigned this Jul 24, 2020
@smoench smoench force-pushed the improve-console-output-formatter branch from b4828c2 to 12adc94 Compare August 7, 2020 12:15
@smoench smoench marked this pull request as ready for review August 7, 2020 13:20
@that-guy-iain
Copy link
Contributor

that-guy-iain commented Sep 21, 2020

As someone who likes to use a small terminal, it would be good if we could have a multi-line output. I'm not sure how it would look but having the two classes on different lines so I don't need to either enlargen my terminal or copy and paste into somewhere else to read the output would be nice.

Also, the reason is always the same?

@smoench
Copy link
Contributor Author

smoench commented Sep 22, 2020

@iaicam I've updated the example. There are three options for the reason column Violation, Skipped and Uncovered.

Symfony's table has an option set the max column width. This might be an option to enforce multi-line output. I will try it out.

@smoench smoench force-pushed the improve-console-output-formatter branch from 8af16cd to 152baa7 Compare September 22, 2020 07:20
@smoench smoench changed the title use table for console output formatter introduce table output formatter Oct 19, 2020
@smoench smoench force-pushed the improve-console-output-formatter branch from 6b8e54b to 83b27c5 Compare October 19, 2020 08:19
@smoench smoench force-pushed the improve-console-output-formatter branch from 83b27c5 to 7e03079 Compare October 19, 2020 08:26
@smoench smoench removed the request for review from timglabisch October 19, 2020 08:30
@smoench smoench merged commit 77547e9 into master Oct 19, 2020
@smoench smoench deleted the improve-console-output-formatter branch October 19, 2020 14:55
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.

Improve console formatter output
2 participants