MCPcopy Create free account
hub / github.com/breck7/scroll / formatFile

Method formatFile

scroll.js:143–149  ·  view source on GitHub ↗
(scrollProgram)

Source from the content-addressed store, hash-verified

141 // Formatting is currently defined as formatting the entire original source file
142 // using the last parser present.
143 async formatFile(scrollProgram) {
144 await scrollProgram.ensureFileLoaded()
145 const { formatted, filePath, filename, codeAtStart } = scrollProgram
146 if (codeAtStart === formatted) return
147 await this.sfs.write(filePath, formatted)
148 this.log(`💾 formatted ${filename}`)
149 }
150
151 // A user provides a list of filenames such as 'index.scroll ../foobar.scroll' and we
152 // know the cwd, turn them into absolute file paths

Callers 1

formatCommandMethod · 0.95

Calls 2

logMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected