Skip to content

Commit dce39d8

Browse files
committed
format scripts/res
1 parent 94f1350 commit dce39d8

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

scripts/format.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ echo Formatting OCaml code...
66
dune build @fmt --auto-promote
77

88
echo Formatting ReScript code...
9-
files=$(find runtime tests -type f \( -name "*.res" -o -name "*.resi" \) ! -name "syntaxErrors*" ! -name "generated_mocha_test.res" ! -path "tests/syntax_tests*" ! -path "tests/analysis_tests/tests*" ! -path "*/node_modules/*")
9+
files=$(find runtime tests scripts/res -type f \( -name "*.res" -o -name "*.resi" \) ! -name "syntaxErrors*" ! -name "generated_mocha_test.res" ! -path "tests/syntax_tests*" ! -path "tests/analysis_tests/tests*" ! -path "*/node_modules/*")
1010
./cli/rescript.js format $files
1111

1212
echo Formatting JS code...

scripts/res/GenApiDocs.res

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ module Docgen = RescriptTools.Docgen
1212

1313
let packagePath = Path.join([Node.dirname, "..", "..", "package.json"])
1414
let version = switch Fs.readFileSync(packagePath, ~encoding="utf8")->JSON.parseOrThrow {
15-
| Object(dict{"version": JSON.String(version)}) => version
16-
| _ => JsError.panic("Invalid package.json format")
15+
| Object(dict{"version": JSON.String(version)}) => version
16+
| _ => JsError.panic("Invalid package.json format")
1717
}
1818
let version = Semver.parse(version)->Option.getOrThrow
1919
let version = Semver.toString({...version, preRelease: None}) // Remove pre-release identifiers for API docs
@@ -22,7 +22,6 @@ if !Fs.existsSync(dirVersion) {
2222
Fs.mkdirSync(dirVersion)
2323
}
2424

25-
2625
let entryPointFiles = ["Belt.res", "Dom.res", "Js.res", "Stdlib.res"]
2726

2827
let hiddenModules = ["Js.Internal", "Js.MapperRt"]
@@ -56,9 +55,10 @@ let docsDecoded = entryPointFiles->Array.map(libFile =>
5655
},
5756
)->Buffer.toString
5857

59-
let docs = output
60-
->JSON.parseOrThrow
61-
->Docgen.decodeFromJson
58+
let docs =
59+
output
60+
->JSON.parseOrThrow
61+
->Docgen.decodeFromJson
6262
Console.log(`Generated docs from ${libFile}`)
6363
docs
6464
} catch {

0 commit comments

Comments
 (0)