cli/lint-docker.js
function lintFile (linter, fileName) {
  const fileContents = fs.readFileSync(fileName, {encoding: 'utf8'}).toString()
  const report = linter.validate(fileContents)
  const errors = report.error.count
  const warnings = report.warn.count

  if (errors || warnings) {
    this.printFilePath(fileName)

    report.error.data.forEach(logItem.bind(this))
    report.warn.data.forEach(logItem.bind(this))

    console.log('') // logging empty line
  }

  return report
}
function lintFile (linter, fileName) {
  const fileContents = fs.readFileSync(fileName, {encoding: 'utf8'}).toString()
  const report = linter.validate(fileContents)
  const errors = report.error.count
  const warnings = report.warn.count

  if (errors || warnings) {
    this.printFilePath(fileName)

    report.error.data.forEach(logItem.bind(this))
    report.warn.data.forEach(logItem.bind(this))

    console.log('') // logging empty line
  }

  return report
}
function lintFile ( linter , fileName ) { const fileContents = fs . readFileSync ( fileName , { encoding : 'utf8' } ) . toString ( ) const report = linter . validate ( fileContents ) const errors = report . error . count const warnings = report . warn . count if ( errors || warnings ) { this . printFilePath ( fileName ) report . error . data . forEach ( logItem . bind ( this ) ) report . warn . data . forEach ( logItem . bind ( this ) ) console . log ( '' ) // logging empty line } return report }
Lint a single Dockerfile
@param {Object} linter - linter
@param {String} fileName - name of file to lint
@returns {Object} lint result
Lint a single Dockerfile