-
Notifications
You must be signed in to change notification settings - Fork 283
Open
Labels
Description
There is a very helpful ability to perform regression testing of formatting changes:
- Clone https://github.com/olafurpg/scala-repos (a large bunch of real world Scala code)
- Format it with scalafmt built from master (or last release)
- Format it with scalafmt built from your branch
- push scala-repos changes
- Add link to commit difference to your PR
It would be good to have GitHub bot (or something like it) that can react on "regress, please" comment on pull request and run job with regression testing. And the add comment with difference link to PR.
Script draft:
#!/bin/bash
LAST_RELEASE=v2.4.2
REPOS=/tmp/regress-tests
BRANCH=alignment-fix
CONFIG=/tmp/.scalafmt.conf
build_scalafmt () {
cd $REPOS/scalafmt
git pull
git checkout $1
sbt cli/assembly
}
format_scala_repos () {
cd $REPOS/scala-repos
git checkout master
git pull
git branch $BRANCH
git checkout $BRANCH
java -jar $REPOS/scalafmt/scalafmt-cli/target/scala-2.13/scalafmt.jar -c $CONFIG $REPOS/scala-repos/
git commit -a -m "formatted with ${1}"
git push -u origin HEAD
}
git clone git@github.com:poslegm/scalafmt.git $REPOS/scalafmt
git clone git@github.com:poslegm/scala-repos.git $REPOS/scala-repos
build_scalafmt $LAST_RELEASE
format_scala_repos $LAST_RELEASE
build_scalafmt $BRANCH
format_scala_repos $BRANCHRelated: #154
Reactions are currently unavailable