google-code-export / wro4j

Automatically exported from code.google.com/p/wro4j
1 stars 1 forks source link

Allow custom reporters for errors #699

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
It would be terribly beneficial to be able to provide a file to function as a 
reporter, the way that vanilla JSHint allows.

JSHint supports this with the --reporter=myReporter.js flag. It could be 
supported here in the configuration, like:

<plugin>
    ...
    <configuration>
        ...
        <reporter>${basedir}/path/to/myReporter.js</reporter>
    </configuration>
</plugin>

Original issue reported on code.google.com by Cineris1...@gmail.com on 2 Apr 2013 at 5:25

GoogleCodeExporter commented 9 years ago
Could you provide more details? What is the purpose of the reporter file? What 
should it contain? Any references (links, examples) would also help understand 
the requirement better.

Original comment by alex.obj...@gmail.com on 2 Apr 2013 at 7:59

GoogleCodeExporter commented 9 years ago
The purpose of the reporter is that the user can write a file containing a 
function that overrides JSHint's default output function.

Each file must have one function, reporter, that accepts an array of error 
objects.

The link below details how to write a custom reporter:
http://www.jshint.com/docs/reporter/

After the file is written, it is passed into the JSHint call like:
jshint --reporter=myReporter.js myFile.js

Original comment by Cineris1...@gmail.com on 3 Apr 2013 at 1:45

GoogleCodeExporter commented 9 years ago
The jshint validation is performed on the server-side, so there is not much 
point of invoking a custom reporter.js on completion. 
What is your use-case? What exactly do you need to do in your custom reporter?
By default, the jshint plugin generates xml reports which contains the detailed 
description of all the problems found during code static analysis. 

Original comment by alex.obj...@gmail.com on 3 Apr 2013 at 2:20

GoogleCodeExporter commented 9 years ago
I was not aware of the generated xml file. That should suit my use case.

As a side note, it would be a nice-to-have to be able to specify a format for 
errors reported in the console output.

Thank you.

Original comment by Cineris1...@gmail.com on 3 Apr 2013 at 2:27

GoogleCodeExporter commented 9 years ago
The documentation is not complete, so there is no question why users are not 
aware about these features. I'll update the documentation.

If you agree, I will close this issue with WONTFIX resolution.

Original comment by alex.obj...@gmail.com on 3 Apr 2013 at 3:23

GoogleCodeExporter commented 9 years ago
That is fair. Thanks for taking the time to address my concerns.

Original comment by Cineris1...@gmail.com on 3 Apr 2013 at 4:48

GoogleCodeExporter commented 9 years ago

Original comment by alex.obj...@gmail.com on 3 Apr 2013 at 8:06