enforce prettier style in formatting tasks

This commit is contained in:
Brian Hicks 2022-05-24 11:43:47 -05:00
parent f77b9a52e3
commit 9798b1b86b
No known key found for this signature in database
GPG Key ID: C4F324B9CAAB0D50

View File

@ -106,11 +106,22 @@ main = do
cmd (WithStdout True) (FileStdout out) "elm-verify-examples"
"log/format.txt" %> \out -> do
need ["log/elm-format.txt", "log/prettier.txt"]
"log/elm-format.txt" %> \out -> do
let placesToLook = ["src", "tests", "styleguide", "styleguide-app"]
elmFiles <- getDirectoryFiles "." (map (\place -> place </> "**" </> "*.elm") placesToLook)
need elmFiles
cmd (WithStdout True) (FileStdout out) "elm-format" "--validate" placesToLook
"log/prettier.txt" %> \out -> do
(Stdout trackedFilesOut) <- cmd "git" "ls-files"
let trackedFiles = lines trackedFilesOut
let jsFiles = filter (\name -> takeExtension name == ".js") trackedFiles
need ("log/npm-install.txt" : jsFiles)
cmd (WithStdout True) (FileStdout out) "./node_modules/.bin/prettier" "--check" jsFiles
"log/puppeteer-tests.txt" %> \out -> do
percyToken <- getEnv "PERCY_TOKEN"
case percyToken of