[scalastyle batch] produce xml report

161 views
Skip to first unread message

Ugo Bourdon

unread,
Dec 12, 2013, 11:21:39 AM12/12/13
to scalasty...@googlegroups.com
Hello
I use scalastyle-batch to check my scala project.
My problem is the command line produce a "poor structured" file like this :


warning file=/path/project/src/main/scala/package/TheClass.scala message=Header does not match expected text line=1
warning file=/path/project/src/main/scala/package/TheClass.scala message=Method name does not match the regular expression '^[a-z][A-Za-z0-9]*$' line=25 column=6
warning file=/path/project/src/main/scala/package/TheClass.scala message=Public method must have explicit type line=15 column=6

Is it possible to have xml report with batch mode of library ? Or I must use sbt plugin to have this ?

Thx for your responses.

Ugo

Matthew Farwell

unread,
Dec 12, 2013, 12:21:58 PM12/12/13
to scalasty...@googlegroups.com
Hello, you can use the --xmlOutput option:

$ java -jar scalastyle-batch_2.10.jar  --xmlOutput foo.xml --config scalastyle_config.xml src

This gives an xml output in checkstyle 5.0 format. The other options are displayed if you specify --help:

$ java -jar ../scalastyle-batch/target/scalastyle-batch_2.10.jar
Error: Unknown argument '--help'
Error: missing arguments: <directory>

scalastyle 0.3.3-SNAPSHOT
Usage: scalastyle [options] <directory>

  -c <value> | --config <value>
        configuration file (required)
  -v <value> | --verbose <value>
        verbose
  -q <value> | --quiet <value>
        quiet
  --xmlOutput <value>
        XML output (optional)
  --xmlEncoding <value>
        XML output encoding (optional)
  --inputEncoding <value>
        Source file encoding (input) (optional)
  -w <value> | --warnings <value>
        fail if there are warnings
  <directory>
        directories / files

Have fun,

Matthew Farwell.


2013/12/12 Ugo Bourdon <bourd...@gmail.com>

--
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes Scalastyle users.
Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse scalastyle-use...@googlegroups.com.
Pour envoyer un message à ce groupe, adressez un e-mail à scalasty...@googlegroups.com.
Visitez ce groupe à l'adresse http://groups.google.com/group/scalastyle-users .
Pour plus d'options, visitez le site https://groups.google.com/groups/opt_out .

Ugo Bourdon

unread,
Dec 12, 2013, 12:32:34 PM12/12/13
to scalasty...@googlegroups.com
Great !
Thx !
Reply all
Reply to author
Forward
0 new messages