From 54563d39dd010ca8ab5f7f4868670f16a553b336 Mon Sep 17 00:00:00 2001 From: gumi Date: Wed, 17 Jun 2020 17:36:04 +0000 Subject: [ci skip] add editorconfig and fix misc formatting --- .editorconfig | 12 ++++++++++++ Makefile | 2 +- src/build.ts | 24 ++++++++++++------------ 3 files changed, 25 insertions(+), 13 deletions(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..40e3782 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,12 @@ +# top-most EditorConfig file +root = true + +[*] +indent_style = tab +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true + +[*.md] +indent_style = space +indent_size = 4 diff --git a/Makefile b/Makefile index 16884f5..4384ee9 100644 --- a/Makefile +++ b/Makefile @@ -9,4 +9,4 @@ build: .PHONY: deno # installs deno (only use this in CI) deno: - curl -fsSL https://deno.land/x/install/install.sh | sh \ No newline at end of file + curl -fsSL https://deno.land/x/install/install.sh | sh diff --git a/src/build.ts b/src/build.ts index 19c6141..4749057 100644 --- a/src/build.ts +++ b/src/build.ts @@ -6,15 +6,15 @@ interface PolicyYFM { name: string; description: string; aliases?: string[]; - ignore?: boolean; - autoupdate?: { - forums?: { - forum?: number; - topic?: number; - post: number; - }; - wiki?: string; - }; + ignore?: boolean; + autoupdate?: { + forums?: { + forum?: number; + topic?: number; + post: number; + }; + wiki?: string; + }; } const decoder = new TextDecoder("utf-8"); @@ -89,14 +89,14 @@ for await (const dirEntry of Deno.readDir("policies")) { // add to the netlify redirect file redirects += `/${shortName} /${shortName}/index.html 200!\n`; - + // built-in aliases if (shortName != shortName.replace("-", "_")) { redirects += `/${shortName.replace("-", "_")} /${shortName} 302\n`; } if (shortName != shortName.replace("-", "")) { redirects += `/${shortName.replace("-", "")} /${shortName} 302\n`; } - + // process path aliases if (Reflect.has(YFM, "aliases")) { for (const alias of YFM.aliases as string[]) { @@ -151,4 +151,4 @@ for await (const dirEntry of Deno.readDir("src/static")) { await Deno.copyFile(`src/static/${dirEntry.name}`, `build/${dirEntry.name}`,); } -console.info(">> Build success ✅"); \ No newline at end of file +console.info(">> Build success ✅"); -- cgit v1.2.3-70-g09d2