Skip to content

Commit

Permalink
Correct spelling of containername argument.
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.
  • Loading branch information
Kurt-von-Laven committed Jun 28, 2022
1 parent a172c54 commit e13ce37
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
1 change: 0 additions & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,6 @@
"conda",
"configfile",
"configfiles",
"containername",
"contextlib",
"contextmanager",
"copypaste",
Expand Down
2 changes: 1 addition & 1 deletion docs/mega-linter-runner.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,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 | <!-- --> |

_You can also use `npx mega-linter-runner` if you do not want to install the package_

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 @@ -101,7 +101,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 | <!-- --> |

_You can also use `npx mega-linter-runner` if you do not want to install the package_

Expand Down
2 changes: 1 addition & 1 deletion mega-linter-runner/lib/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ module.exports = optionator({
description: "Upgrade local repository MegaLinter configuration",
},
{
option: "containername",
option: "container-name",
type: "String",
description: "Specify MegaLinter container name",
},
Expand Down
16 changes: 10 additions & 6 deletions mega-linter-runner/lib/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,17 @@ ERROR: Docker engine has not been found on your system.
// Build docker run options
const lintPath = path.resolve(options.path || ".");
const commandArgs = ["run"];
if (options.containername) {
commandArgs.push(...["--name", options.containername]);
if (options["container-name"]) {
commandArgs.push(...["--name", options["container-name"]]);
}
commandArgs.push(...[
"-v", "/var/run/docker.sock:/var/run/docker.sock:rw",
"-v", `${lintPath}:/tmp/lint:rw`,
]);
commandArgs.push(
...[
"-v",
"/var/run/docker.sock:/var/run/docker.sock:rw",
"-v",
`${lintPath}:/tmp/lint:rw`,
]
);
if (options.fix === true) {
commandArgs.push(...["-e", "APPLY_FIXES=all"]);
}
Expand Down

0 comments on commit e13ce37

Please sign in to comment.