Skip to content

Commit

Permalink
refactor(formatting): improve quoting style of objects to consistent-…
Browse files Browse the repository at this point in the history
  • Loading branch information
drubin committed Nov 22, 2018
1 parent 2c12317 commit 687c6f3
Show file tree
Hide file tree
Showing 14 changed files with 30 additions and 30 deletions.
4 changes: 2 additions & 2 deletions garden-service/src/commands/create/config-templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { ModuleConfig } from "../../config/module"
* Alternatively, consider co-locating the templates with the plugins.
*/
export const MODULE_PROVIDER_MAP = {
container: "local-kubernetes",
"container": "local-kubernetes",
"google-cloud-function": "local-google-cloud-functions",
"npm-package": "npm-package",
}
Expand Down Expand Up @@ -91,7 +91,7 @@ export const projectTemplate = (name: string, moduleTypes: ModuleType[]): Projec

export const moduleTemplate = (name: string, type: ModuleType): ModuleTemplate => {
const moduleTypeTemplate = {
container: containerTemplate,
"container": containerTemplate,
"google-cloud-function": googleCloudFunctionTemplate,
"npm-package": npmPackageTemplate,
}[type]
Expand Down
2 changes: 1 addition & 1 deletion garden-service/src/commands/create/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const createProjectOptions = {
"module-dirs": new PathsParameter({
help: "Relative path to modules directory. Use comma as a separator to specify multiple directories.",
}),
name: new StringParameter({
"name": new StringParameter({
help: "Assigns a custom name to the project (defaults to name of the current directory).",
}),
}
Expand Down
4 changes: 2 additions & 2 deletions garden-service/src/commands/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ const deployArgs = {
}

const deployOpts = {
force: new BooleanParameter({ help: "Force redeploy of service(s)." }),
"force": new BooleanParameter({ help: "Force redeploy of service(s)." }),
"force-build": new BooleanParameter({ help: "Force rebuild of module(s)." }),
watch: new BooleanParameter({ help: "Watch for changes in module(s) and auto-deploy.", alias: "w" }),
"watch": new BooleanParameter({ help: "Watch for changes in module(s) and auto-deploy.", alias: "w" }),
"hot-reload": new StringsParameter({
help: deline`The name(s) of the service(s) to deploy with hot reloading enabled.
Use comma as a separator to specify multiple services. When this option is used,
Expand Down
2 changes: 1 addition & 1 deletion garden-service/src/commands/run/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const runArgs = {
const runOpts = {
// TODO: we could provide specific parameters like this by adding commands for specific modules, via plugins
//entrypoint: new StringParameter({ help: "Override default entrypoint in module" }),
interactive: new BooleanParameter({
"interactive": new BooleanParameter({
help: "Set to false to skip interactive mode and just output the command result.",
defaultValue: true,
}),
Expand Down
2 changes: 1 addition & 1 deletion garden-service/src/commands/run/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const runArgs = {
}

const runOpts = {
interactive: new BooleanParameter({
"interactive": new BooleanParameter({
help: "Set to false to skip interactive mode and just output the command result.",
defaultValue: true,
}),
Expand Down
6 changes: 3 additions & 3 deletions garden-service/src/commands/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ const testArgs = {
}

const testOpts = {
name: new StringOption({
"name": new StringOption({
help: "Only run tests with the specfied name (e.g. unit or integ).",
alias: "n",
}),
force: new BooleanParameter({ help: "Force re-test of module(s).", alias: "f" }),
"force": new BooleanParameter({ help: "Force re-test of module(s).", alias: "f" }),
"force-build": new BooleanParameter({ help: "Force rebuild of module(s)." }),
watch: new BooleanParameter({ help: "Watch for changes in module(s) and auto-test.", alias: "w" }),
"watch": new BooleanParameter({ help: "Watch for changes in module(s) and auto-test.", alias: "w" }),
}

type Args = typeof testArgs
Expand Down
2 changes: 1 addition & 1 deletion garden-service/src/config-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export interface LocalConfig {

const kubernetesLocalConfigSchema = Joi.object()
.keys({
username: joiIdentifier().allow("").optional(),
"username": joiIdentifier().allow("").optional(),
"previous-usernames": Joi.array().items(joiIdentifier()).optional(),
})
.meta({ internal: true })
Expand Down
14 changes: 7 additions & 7 deletions garden-service/test/src/commands/create/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe("CreateProjectCommand", () => {
const { result } = await cmd.action({
garden,
args: { "project-dir": "" },
opts: { name: "", "module-dirs": [] },
opts: { "name": "", "module-dirs": [] },
})
const modules = result.modules.map(m => pick(m, ["name", "type", "path"]))
const project = pick(result.project, ["name", "path"])
Expand All @@ -75,7 +75,7 @@ describe("CreateProjectCommand", () => {
const { result } = await cmd.action({
garden,
args: { "project-dir": "new-project" },
opts: { name: "", "module-dirs": [] },
opts: { "name": "", "module-dirs": [] },
})
expect(pick(result.project, ["name", "path"])).to.eql({
name: "new-project",
Expand All @@ -89,7 +89,7 @@ describe("CreateProjectCommand", () => {
const { result } = await cmd.action({
garden,
args: { "project-dir": "" },
opts: { name: "my-project", "module-dirs": [] },
opts: { "name": "my-project", "module-dirs": [] },
})
expect(pick(result.project, ["name", "path"])).to.eql({
name: "my-project",
Expand All @@ -103,7 +103,7 @@ describe("CreateProjectCommand", () => {
const { result } = await cmd.action({
garden,
args: { "project-dir": "" },
opts: { name: "", "module-dirs": ["."] },
opts: { "name": "", "module-dirs": ["."] },
})
expect(result.modules.map(m => pick(m, ["name", "type", "path"]))).to.eql([
{ type: "container", name: "module-a", path: join(garden.projectRoot, "module-a") },
Expand All @@ -117,7 +117,7 @@ describe("CreateProjectCommand", () => {
const { result } = await cmd.action({
garden,
args: { "project-dir": "" },
opts: { name: "", "module-dirs": ["module-a", "module-b"] },
opts: { "name": "", "module-dirs": ["module-a", "module-b"] },
})
expect(result.modules.map(m => pick(m, ["name", "type", "path"]))).to.eql([
{ type: "container", name: "child-module-a", path: join(garden.projectRoot, "module-a", "child-module-a") },
Expand All @@ -132,7 +132,7 @@ describe("CreateProjectCommand", () => {
async () => await cmd.action({
garden,
args: { "project-dir": "___" },
opts: { name: "", "module-dirs": [] },
opts: { "name": "", "module-dirs": [] },
}),
"configuration",
)
Expand All @@ -145,7 +145,7 @@ describe("CreateProjectCommand", () => {
async () => await cmd.action({
garden,
args: { "project-dir": "" },
opts: { name: "___", "module-dirs": [] },
opts: { "name": "___", "module-dirs": [] },
}),
"configuration",
)
Expand Down
8 changes: 4 additions & 4 deletions garden-service/test/src/commands/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ describe("DeployCommand", () => {
},
opts: {
"hot-reload": undefined,
watch: false,
force: false,
"watch": false,
"force": false,
"force-build": true,
},
})
Expand Down Expand Up @@ -135,8 +135,8 @@ describe("DeployCommand", () => {
},
opts: {
"hot-reload": undefined,
watch: false,
force: false,
"watch": false,
"force": false,
"force-build": true,
},
})
Expand Down
4 changes: 2 additions & 2 deletions garden-service/test/src/commands/run/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe("RunModuleCommand", () => {
const { result } = await cmd.action({
garden,
args: { module: "run-test", command: [] },
opts: { interactive: false, "force-build": false },
opts: { "interactive": false, "force-build": false },
})

const expected: RunResult = {
Expand All @@ -55,7 +55,7 @@ describe("RunModuleCommand", () => {
const { result } = await cmd.action({
garden,
args: { module: "run-test", command: ["my", "command"] },
opts: { interactive: false, "force-build": false },
opts: { "interactive": false, "force-build": false },
})

const expected: RunResult = {
Expand Down
4 changes: 2 additions & 2 deletions garden-service/test/src/commands/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe("commands.test", () => {
const { result } = await command.action({
garden,
args: { module: undefined },
opts: { name: undefined, force: true, "force-build": true, watch: false },
opts: { "name": undefined, "force": true, "force-build": true, "watch": false },
})

expect(isSubset(taskResultOutputs(result!), {
Expand Down Expand Up @@ -46,7 +46,7 @@ describe("commands.test", () => {
const { result } = await command.action({
garden,
args: { module: ["module-a"] },
opts: { name: undefined, force: true, "force-build": true, watch: false },
opts: { "name": undefined, "force": true, "force-build": true, "watch": false },
})

expect(isSubset(taskResultOutputs(result!), {
Expand Down
2 changes: 1 addition & 1 deletion garden-service/test/src/garden.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ describe("Garden", () => {
{ name: "test-plugin" },
],
variables: {
some: "banana",
"some": "banana",
"service-a-build-command": "OK",
},
})
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"check-package-lock": "git diff --quiet HEAD -- package-lock.json || (echo 'package-lock.json is dirty!' && exit 1)",
"clean": "lerna run clean && git clean -X -f",
"dist": "gulp dist",
"fix-format": "node_modules/.bin/tslint -p . --fix && node_modules/.bin/tsfmt -r",
"fix-format": "tslint -p . --fix && tsfmt -r",
"generate-docs": "gulp generate-docs",
"integ": "lerna run integ",
"lint": "tslint -p . && tsfmt --verify && gulp check-licenses",
Expand Down
4 changes: 2 additions & 2 deletions tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"number-literal-format": true,
"object-literal-key-quotes": [
true,
"as-needed"
"consistent-as-needed"
],
"object-literal-shorthand": true,
"one-variable-per-declaration": true,
Expand Down Expand Up @@ -83,4 +83,4 @@
"check-separator"
]
}
}
}

0 comments on commit 687c6f3

Please sign in to comment.