phpinsights icon indicating copy to clipboard operation
phpinsights copied to clipboard

Implement option to output issues grouped by file

Open JacekAndrzejewski opened this issue 6 years ago • 6 comments
trafficstars

Q A
Bug report? no
Feature request? yes
Library version 1.7.0

Right now all found issues are grouped by type of issue and sniffer name. That's good, but if I wanted to fix all found issues in one file then I would have to search for file path in output. In big projects this may be a problem.

That's why I think there should be an option to output issues grouped by file path.

JacekAndrzejewski avatar Jun 27 '19 14:06 JacekAndrzejewski

Great idea! Before we implement this, a workaround for you could be to use the new feature to specify a file when running this package.

This way you get faster insights as it is only scanning one file and you only see issues for that file🤩

olivernybroe avatar Jun 27 '19 15:06 olivernybroe

Right now as a workaround I pipe output into txt file and then sort lines lexicographically with "String Manipulation" plugin for PHPStorm. Works good enough even for 30k+ lines of output.

JacekAndrzejewski avatar Jun 28 '19 07:06 JacekAndrzejewski

@JacekAndrzejewski Sounds really cool!

We actually have a PR #201 which prob. soon will get merged which will help make that part easier also as it removes all data from which is not related to the result when you pipe data. It also adds a json format.

Btw you can add phpinsight as a external tool and trigger it per file to get the result fast and easy in phpstorm image

olivernybroe avatar Jun 28 '19 07:06 olivernybroe

@olivernybroe I don't see the output anywhere. Not sure if this even triggers? Am I missing something?

image

MrMadClown avatar Oct 14 '19 13:10 MrMadClown

@MrMadClown It doesn't trigger automatically, you have to run it manually :)

I have actually created a plugin for phpstorm which runs the tool automatically, which you also could use. (working on a update for it to work on newest version of phpstorm consistently)

olivernybroe avatar Oct 14 '19 15:10 olivernybroe

@olivernybroe Oh right! It's not a File Watcher, for some reason I thought that. Thanks for the plugin, I'll check it immediately.

MrMadClown avatar Oct 17 '19 07:10 MrMadClown