From 2a6ddcdf8669be4546e50d9f578b770860c83f74 Mon Sep 17 00:00:00 2001 From: Kurt von Laven Date: Wed, 5 Oct 2022 01:33:07 -0700 Subject: [PATCH] Correct spelling of containername argument. (#1571) Spell the new mega-linter-runner argument container-name for consistency with the package name, mega-linter-runner, and to spare users from needing to add containername as a CSpell exception. Continue to accept containername for backwards compatibility. --- .pre-commit-hooks.yaml | 4 ++-- mega-linter-runner/README.md | 2 +- mega-linter-runner/lib/options.js | 3 ++- mega-linter-runner/lib/runner.js | 4 ++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index ebcaef06eb5..d9aa313e8a4 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -5,7 +5,7 @@ require_serial: true args: - mega-linter-runner - - --containername "megalinter-$(basename "$PWD")" + - --container-name "megalinter-$(basename "$PWD")" - --remove-container - --fix - --env @@ -35,7 +35,7 @@ require_serial: true args: - mega-linter-runner - - --containername "megalinter-all-$(basename "$PWD")" + - --container-name "megalinter-all-$(basename "$PWD")" - --remove-container - --fix - --env diff --git a/mega-linter-runner/README.md b/mega-linter-runner/README.md index a427ae27bb7..6749e27443a 100644 --- a/mega-linter-runner/README.md +++ b/mega-linter-runner/README.md @@ -105,7 +105,7 @@ The options are only related to mega-linter-runner. For MegaLinter options, plea | `-h`
`--help` | Show mega-linter-runner help | | | `-v`
`--version` | Show mega-linter-runner version | | | `-i`
`--install` | Generate MegaLinter configuration files | | -| `--containername` | Specify MegaLinter container name | | +| `--container-name` | Specify MegaLinter container name | | | `--remove-container` | Remove MegaLinter Docker container when done | | _You can also use `npx mega-linter-runner` if you do not want to install the package_ diff --git a/mega-linter-runner/lib/options.js b/mega-linter-runner/lib/options.js index 62e553d0f99..89968eab20d 100644 --- a/mega-linter-runner/lib/options.js +++ b/mega-linter-runner/lib/options.js @@ -122,7 +122,8 @@ module.exports = optionator({ description: "Upgrade local repository MegaLinter configuration", }, { - option: "containername", + option: "container-name", + alias: "containername", type: "String", description: "Specify MegaLinter container name", }, diff --git a/mega-linter-runner/lib/runner.js b/mega-linter-runner/lib/runner.js index 0adb505cdba..3654bb56663 100644 --- a/mega-linter-runner/lib/runner.js +++ b/mega-linter-runner/lib/runner.js @@ -124,8 +124,8 @@ ERROR: Docker engine has not been found on your system. if (options["removeContainer"]) { commandArgs.push("--rm"); } - if (options.containername) { - commandArgs.push(...["--name", options.containername]); + if (options["containerName"]) { + commandArgs.push(...["--name", options["containerName"]]); } commandArgs.push(...["-v", "/var/run/docker.sock:/var/run/docker.sock:rw"]); commandArgs.push(...["-v", `${lintPath}:/tmp/lint:rw`]);