mikr/whatstyle

Whatstyle does not seem to work with scalafmt correctly

tovbinm opened this issue · 2 comments

Howdy,

I tries running the following command by no style was found:

./whatstyle.py -v --difftool diff -l scala -f scalafmt --variants tests/examples/spark/SparkLR.scala

Output:

-----------------------
Running whatstyle 0.1.5
Using formatter /usr/local/bin/scalafmt (scalafmt 1.5.1)
Using this for comparing files: diff --text --unified=0 -- #FILENAME# -
Round 0  #formatted 1/1  #compared 1/1
Best distance minimizing differences round 0: (0, 0, 0, 0, 3, 0, 1)


Round 1  #formatted 3/3
The formatter was run 4 times of which 0 runs were unusable.

### This style was chosen for your .scalafmt - it perfectly matches your sources.


Tweaking all option values, #formatted 7/7
/usr/local/bin/scalafmt




Summary:
Found 0 options where a different value changed the result.
From these we generated 0 style differences.
mikr commented

Thanks for the heads up. The scalafmt support was completely outdated. Unfortunately scalafmt dropped option discovery and adopted more powerful but complicated nested options that would take some effort to support.
So I just cobbled up about 50 options for scalafmt 1.5.1 that can easily be supported and pushed whatstyle version 0.1.6.
Your command line should work with this version.

Thank you @mikr !!