Skip to content

Commit e4dd297

Browse files
authored
Merge pull request #138 from jwiebalk/jwiebalk/add_config
Add a config option to process all Dockerfiles with the same configuration file
2 parents 7a7abf6 + 89a53ee commit e4dd297

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

bin/dockerfilelint

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,12 @@ var argv = require('yargs')
1717
desc: 'Output linting results as JSON, equivalent to `-o json`.',
1818
type: 'boolean'
1919
})
20+
.option('c', {
21+
alias: 'config',
22+
desc: 'Path for .dockerfilelintrc configuration file',
23+
type: 'string'
24+
})
2025
.alias('v', 'version')
21-
.version(() => require('../package.json').version)
2226
.help().alias('h', 'help')
2327
.example('dockerfilelint Dockerfile', 'Lint a Dockerfile in the current working directory\n')
2428
.example('dockerfilelint test/example/* -j', 'Lint all files in the test/example directory and output results in JSON\n')
@@ -64,7 +68,7 @@ argv._.forEach((fileName) => {
6468
if (stats.isFile()) {
6569
fileContent = fs.readFileSync(fileName, 'UTF-8');
6670
var root = (os.platform == "win32") ? process.cwd().split(path.sep)[0] : "/";
67-
configFilePath = path.resolve(path.dirname(fileName));
71+
configFilePath = argv.config || path.resolve(path.dirname(fileName));
6872
}
6973
} catch (e) {
7074
if (e.code === 'ENOENT') {

0 commit comments

Comments
 (0)