Fix trailing new line
This commit is contained in:
parent
98635fca28
commit
de06f0839e
|
@ -6,4 +6,4 @@ end_of_line = lf
|
|||
insert_final_newline = true
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
trim_trailing_whitespace = true
|
||||
trim_trailing_whitespace = true
|
||||
|
|
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,3 +1,3 @@
|
|||
deno.d.ts
|
||||
.vscode
|
||||
.local
|
||||
.local
|
||||
|
|
2
run
2
run
|
@ -16,4 +16,4 @@ else
|
|||
fi
|
||||
|
||||
denoargs="$(cat config/$denocmd.flags 2> /dev/null) $denoargs $@"
|
||||
exec deno $denocmd $denoargs
|
||||
exec deno $denocmd $denoargs
|
||||
|
|
|
@ -42,6 +42,13 @@ export class ProjectNormalizer {
|
|||
await this.formatPath(path);
|
||||
}
|
||||
|
||||
async writeLines(path: string, lines: string[]) {
|
||||
await this.sys.writeTextFile(
|
||||
path,
|
||||
lines.concat("").join("\n"),
|
||||
);
|
||||
}
|
||||
|
||||
async formatPath(path: string) {
|
||||
await this.sys.run({
|
||||
cmd: ["./run", "fmt", "-q", path],
|
||||
|
@ -49,7 +56,7 @@ export class ProjectNormalizer {
|
|||
}
|
||||
|
||||
async updateRunScript() {
|
||||
await this.sys.writeTextFile(
|
||||
await this.writeLines(
|
||||
"run",
|
||||
[
|
||||
`#!/bin/sh`,
|
||||
|
@ -71,7 +78,7 @@ export class ProjectNormalizer {
|
|||
``,
|
||||
`denoargs="$(cat config/$denocmd.flags 2> /dev/null) $denoargs $@"`,
|
||||
`exec deno $denocmd $denoargs`,
|
||||
].join("\n"),
|
||||
],
|
||||
);
|
||||
await this.sys.chmod("run", 0o755);
|
||||
}
|
||||
|
@ -86,7 +93,7 @@ export class ProjectNormalizer {
|
|||
}
|
||||
|
||||
async updateEditorConfig() {
|
||||
await this.sys.writeTextFile(
|
||||
await this.writeLines(
|
||||
".editorconfig",
|
||||
[
|
||||
`root = true`,
|
||||
|
@ -98,7 +105,7 @@ export class ProjectNormalizer {
|
|||
`indent_style = space`,
|
||||
`indent_size = 2`,
|
||||
`trim_trailing_whitespace = true`,
|
||||
].join("\n"),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -168,25 +175,25 @@ export class ProjectNormalizer {
|
|||
}
|
||||
|
||||
async updateGitIgnore() {
|
||||
await this.sys.writeTextFile(
|
||||
await this.writeLines(
|
||||
".gitignore",
|
||||
[
|
||||
`deno.d.ts`,
|
||||
`.vscode`,
|
||||
`.local`,
|
||||
].join("\n"),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
async updateGitHooks() {
|
||||
await this.sys.writeTextFile(
|
||||
await this.writeLines(
|
||||
".git/hooks/pre-commit",
|
||||
[
|
||||
`#!/bin/sh`,
|
||||
`set -e`,
|
||||
`./run fmt --check`,
|
||||
`./run test`,
|
||||
].join("\n"),
|
||||
],
|
||||
);
|
||||
await this.sys.chmod(".git/hooks/pre-commit", 0o755);
|
||||
}
|
||||
|
@ -203,13 +210,13 @@ export class ProjectNormalizer {
|
|||
}
|
||||
}
|
||||
}
|
||||
await this.sys.writeTextFile(
|
||||
await this.writeLines(
|
||||
"README.md",
|
||||
[
|
||||
`# typescript/${project}`,
|
||||
`[![Build Status](https://thunderk.visualstudio.com/typescript/_apis/build/status/${project}?branchName=master)](https://dev.azure.com/thunderk/typescript/_build?pipelineNameFilter=${project})`,
|
||||
sections,
|
||||
].join("\n"),
|
||||
],
|
||||
);
|
||||
await this.formatPath("README.md");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue