Skip to content

Commit

Permalink
Correct spelling of containername argument. (#1571)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Kurt-von-Laven authored Oct 5, 2022
1 parent 3814ebd commit 2a6ddcd
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
require_serial: true
args:
- mega-linter-runner
- --containername "megalinter-$(basename "$PWD")"
- --container-name "megalinter-$(basename "$PWD")"
- --remove-container
- --fix
- --env
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion mega-linter-runner/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ The options are only related to mega-linter-runner. For MegaLinter options, plea
| `-h` <br/> `--help` | Show mega-linter-runner help | <!-- --> |
| `-v` <br/> `--version` | Show mega-linter-runner version | <!-- --> |
| `-i` <br/> `--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_
Expand Down
3 changes: 2 additions & 1 deletion mega-linter-runner/lib/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
Expand Down
4 changes: 2 additions & 2 deletions mega-linter-runner/lib/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`]);
Expand Down

0 comments on commit 2a6ddcd

Please sign in to comment.