Skip to content

Commit

Permalink
Merge pull request #18 from fatbasstard/url
Browse files Browse the repository at this point in the history
Improve severity mapping
  • Loading branch information
kddejong authored Jan 2, 2019
2 parents 266288d + 7e986c3 commit d7afcd2
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 85 deletions.
18 changes: 17 additions & 1 deletion lib/atom-cfn-lint.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,24 @@ module.exports = {
sourceUrl = match.Rule.Source
}


// Map the linter severity into the Atom linter values (error, warning, info)
// See: https://steelbrain.me/linter/types/linter-message-v2.html
let linterSeverity

switch (match.Level) {
case 'Informational':
linterSeverity = 'info'
break
case 'Warning':
linterSeverity = 'warning'
break
default:
linterSeverity = 'error'
}

toReturn.push({
severity: match.Level.toLowerCase(),
severity: linterSeverity,
excerpt: match.Message,
url: sourceUrl,
location: {
Expand Down
168 changes: 84 additions & 84 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,84 +1,84 @@
{
"name": "atom-cfn-lint",
"main": "./lib/atom-cfn-lint",
"version": "0.6.0",
"description": "Validate CloudFormation yaml/json templates against the CloudFormation spec and additional checks. Includes checking valid values for resource properties and best practices.",
"keywords": [
"linter",
"AWS",
"CloudFormation"
],
"repository": "https://github.com/awslabs/aws-cfn-lint-atom",
"license": "Apache-2.0",
"engines": {
"atom": ">=1.0.0 <2.0.0"
},
"dependencies": {
"atom-linter": "^5.0.2",
"atom-package-deps": "^4.6.0"
},
"package-deps": [
"linter"
],
"scripts": {
"test": "apm test",
"lint": "eslint lib spec"
},
"providedServices": {
"linter": {
"versions": {
"2.0.0": "provideLinter"
}
}
},
"readmeFilename": "README.md",
"devDependencies": {
"babel-eslint": "latest",
"eslint": "^4.19.1",
"eslint-config-airbnb-base": "^12.1.0",
"eslint-plugin-import": "^2.9.0",
"jasmine-fix": "^1.3.0"
},
"eslintConfig": {
"extends": "airbnb-base",
"rules": {
"no-console": "off",
"semi": [
"error",
"never"
],
"comma-dangle": "off",
"global-require": "off",
"import/no-unresolved": [
"error",
{
"ignore": [
"atom"
]
}
],
"object-curly-newline": [
"error",
{
"ObjectExpression": {
"minProperties": 5,
"multiline": true,
"consistent": true
},
"ObjectPattern": {
"minProperties": 5,
"multiline": true,
"consistent": true
}
}
]
},
"globals": {
"atom": "true"
},
"env": {
"node": true,
"browser": true
}
}
}
{
"name": "atom-cfn-lint",
"main": "./lib/atom-cfn-lint",
"version": "0.6.1",
"description": "Validate CloudFormation yaml/json templates against the CloudFormation spec and additional checks. Includes checking valid values for resource properties and best practices.",
"keywords": [
"linter",
"AWS",
"CloudFormation"
],
"repository": "https://github.com/awslabs/aws-cfn-lint-atom",
"license": "Apache-2.0",
"engines": {
"atom": ">=1.0.0 <2.0.0"
},
"dependencies": {
"atom-linter": "^5.0.2",
"atom-package-deps": "^4.6.0"
},
"package-deps": [
"linter"
],
"scripts": {
"test": "apm test",
"lint": "eslint lib spec"
},
"providedServices": {
"linter": {
"versions": {
"2.0.0": "provideLinter"
}
}
},
"readmeFilename": "README.md",
"devDependencies": {
"babel-eslint": "latest",
"eslint": "^4.19.1",
"eslint-config-airbnb-base": "^12.1.0",
"eslint-plugin-import": "^2.9.0",
"jasmine-fix": "^1.3.0"
},
"eslintConfig": {
"extends": "airbnb-base",
"rules": {
"no-console": "off",
"semi": [
"error",
"never"
],
"comma-dangle": "off",
"global-require": "off",
"import/no-unresolved": [
"error",
{
"ignore": [
"atom"
]
}
],
"object-curly-newline": [
"error",
{
"ObjectExpression": {
"minProperties": 5,
"multiline": true,
"consistent": true
},
"ObjectPattern": {
"minProperties": 5,
"multiline": true,
"consistent": true
}
}
]
},
"globals": {
"atom": "true"
},
"env": {
"node": true,
"browser": true
}
}
}

0 comments on commit d7afcd2

Please sign in to comment.