Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dockerfilelint

Package Overview
Dependencies
Maintainers
3
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dockerfilelint - npm Package Compare versions

Comparing version 1.3.0 to 1.4.0

10

CHANGELOG.md

@@ -5,2 +5,12 @@ # Change Log

<a name="1.4.0"></a>
# [1.4.0](https://github.com/replicatedhq/dockerfilelint/compare/v1.3.0...v1.4.0) (2017-09-13)
### Features
* support for multi-stage builds ([#84](https://github.com/replicatedhq/dockerfilelint/issues/84)) ([72d2087](https://github.com/replicatedhq/dockerfilelint/commit/72d2087))
<a name="1.3.0"></a>

@@ -7,0 +17,0 @@ # [1.3.0](https://github.com/replicatedhq/dockerfilelint/compare/v1.2.0...v1.3.0) (2017-09-12)

18

lib/index.js

@@ -53,4 +53,6 @@ 'use strict';

var state = {
instructionsProcessed: 0,
cmdFound: false,
stages: [{
instructionsProcessed: 0,
cmdFound: false // this doesn't seem to be used anywhere
}],
items: [],

@@ -66,7 +68,13 @@ rules: loadRules(configPath)

if (result.command === 'cmd') {
state.cmdFound = true;
state.stages[state.stages.length - 1].cmdFound = true;
} else if (result.command === 'from' && state.stages[state.stages.length - 1].instructionsProcessed !== 0) {
// Each FROM command constitutes a new stage in a multistage build
state.stages.push({
instructionsProcessed: 0,
cmdFound: false
});
}
// And we also care about knowing if this is the first command or not
state.instructionsProcessed = state.instructionsProcessed + 1;
state.stages[state.stages.length - 1].instructionsProcessed++;
};

@@ -121,3 +129,3 @@

// but is not the time (non blank, non commented) line
if ((state.instructionsProcessed === 0 && cmd !== 'from') || (state.instructionsProcessed !== 0 && cmd === 'from')) {
if (state.stages[state.stages.length - 1].instructionsProcessed === 0 && cmd !== 'from') {
items.push(messages.build(state.rules, 'from_first', line));

@@ -124,0 +132,0 @@ }

{
"name": "dockerfilelint",
"version": "1.3.0",
"version": "1.4.0",
"description": "A linter for Dockerfiles to find bugs and encourage best practices",

@@ -5,0 +5,0 @@ "main": "./lib/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc