From 89be5929eb21ac64c344b42b53d362f82f2441e8 Mon Sep 17 00:00:00 2001 From: David Biancolin Date: Tue, 24 May 2022 21:58:31 +0000 Subject: [PATCH] make: Add phony targets for scala formatting --- sim/target-agnostic.mk | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/sim/target-agnostic.mk b/sim/target-agnostic.mk index 033690e4..bccd26cf 100644 --- a/sim/target-agnostic.mk +++ b/sim/target-agnostic.mk @@ -283,6 +283,27 @@ scaladoc: cd $(base_dir) && $(SBT) "project {file:$(firesim_base_dir)}firesim" "unidoc" .PHONY: scaladoc + +######################### +# Scalafmt # +######################### +# Checks that all scala main sources under firesim SBT subprojects are formatted. +scalafmtCheckAll: + cd $(base_dir) && $(SBT) ";project {file:$(firesim_base_dir)}firesim; \ + firesim / scalafmtCheckAll; \ + firesimLib / scalafmtCheckAll; \ + midas / scalafmtCheckAll ; \ + targetutils / scalafmtCheckAll ;" + +# Runs the code reformatter in all firesim SBT subprojects +scalafmtAll: + cd $(base_dir) && $(SBT) ";project {file:$(firesim_base_dir)}firesim; \ + firesim / scalafmtAll; \ + firesimLib / scalafmtAll; \ + midas / scalafmtAll ; \ + targetutils / scalafmtAll ;" + +.PHONY: scalafmtCheckAll scalafmtAll ######################### # Cleaning Recipes # #########################