cfpathcheck
Advanced tools
Comparing version 0.7.1 to 0.8.0
@@ -16,4 +16,7 @@ /*global module, require */ | ||
/** | ||
* Uses lodash isEqual to perform non-strict object comparison. | ||
* | ||
* @see http://stackoverflow.com/a/4587130/167987 | ||
* Uses lodash isEqual to perform non-strict object comparison | ||
* @param {Object} obj - The object to search for. | ||
* @param {Array} list - The array of objects to search. | ||
*/ | ||
@@ -32,2 +35,10 @@ function containsObject(obj, list) { | ||
/** | ||
* Compares two arrays of cfml taglib prefixes to see if there are any mismatches. | ||
* | ||
* @param {Array} prefixArray1 - The first array of taglib prefixes. | ||
* @param {Array} prefixArray2 - The second array of taglib prefixes. | ||
* @param {string} message - The message to display in case of a violation. | ||
* @param {string} severity - The violation severity. | ||
*/ | ||
function comparePrefixArrays(prefixArray1, prefixArray2, message, severity) { | ||
@@ -108,2 +119,7 @@ | ||
/** | ||
* @param {string} str - The string to match. | ||
* @param {RegExp} regex - The RegExp to use. | ||
*/ | ||
function matchAll(str, regex) { | ||
@@ -124,2 +140,7 @@ var res = []; | ||
/** | ||
* @param {string} filePath - The path of the file to check. | ||
* Checks a file for missing paths. | ||
*/ | ||
function checkFile(filePath) { | ||
@@ -193,5 +214,9 @@ var templatePathViolations = []; | ||
var includeMatches = matchAll(line, /template=\"([^"]+)\"/g); | ||
// <cfinclude template="$path" /> | ||
var cfIncludeMatches = matchAll(line, /template=\"([^"]+)\"/g); | ||
includeMatches.forEach(function (includeMatch) { | ||
// include '$path'; (inside <cfscript>) | ||
var includeMatches = matchAll(line, /\binclude\s['"]([^'"]+)['"]/g); | ||
cfIncludeMatches.concat(includeMatches).forEach(function (includeMatch) { | ||
// console.log(includeMatch); | ||
@@ -218,3 +243,3 @@ | ||
column: includeMatch.index + 1, | ||
message: 'cfinclude template path {1} not found'.replace('{1}', templatePath), | ||
message: 'cfinclude/include template path {1} not found'.replace('{1}', templatePath), | ||
severity: 'error' | ||
@@ -249,9 +274,9 @@ }); | ||
check: function check(filePath, format) { | ||
/** | ||
* @param {string} filePath - The full path of the file to check. | ||
*/ | ||
check: function check(filePath) { | ||
var fileNames = []; | ||
var violations = []; | ||
format = format || 'dump'; // Not relevant in node... | ||
// Resolve the path, if a relative path was passed in | ||
@@ -304,2 +329,7 @@ if (!pathIsAbsolute(filePath)) { | ||
/** | ||
* @param {Array} violations - The violations array. | ||
* @param {string} format - The output format to use. | ||
*/ | ||
formatter: function formatter(violations, format) { | ||
@@ -315,2 +345,7 @@ var output; | ||
/** | ||
* @param {string} output - The file contents to write. | ||
* @param {string} outFile - The file to write to. | ||
*/ | ||
writeFile: function writeFile(output, outFile) { | ||
@@ -331,2 +366,6 @@ // Resolve the path if it's not absolute | ||
/** | ||
* @param {string|Array} output - The output to write. | ||
*/ | ||
writeOutput: function writeOutput(output) { | ||
@@ -333,0 +372,0 @@ if (output instanceof Array) { |
{ | ||
"name": "cfpathcheck", | ||
"description": "Check CFML files for correct paths in cfinclude/cfimport tags", | ||
"version": "0.7.1", | ||
"version": "0.8.0", | ||
"homepage": "https://github.com/timbeadle/cfpathcheck", | ||
@@ -17,2 +17,3 @@ "author": { | ||
}, | ||
"license": "MIT", | ||
"licenses": [ | ||
@@ -45,4 +46,4 @@ { | ||
"crlf": "^1.1.0", | ||
"glob": "^7.0.3", | ||
"lodash": "^4.7.0", | ||
"glob": "^7.0.5", | ||
"lodash": "^4.15.0", | ||
"log-symbols": "^1.0.2", | ||
@@ -54,8 +55,10 @@ "minimist": "^1.2.0", | ||
"devDependencies": { | ||
"eslint-plugin-jsdoc": "^2.3.1", | ||
"eslint-plugin-node": "^1.0.0", | ||
"grunt": ">=0.4.5", | ||
"grunt-release": "^0.13.0", | ||
"gruntify-eslint": "^2.0.0", | ||
"grunt": "^1.0.1", | ||
"grunt-eslint": "^18.0.0", | ||
"grunt-release-it": "^1.0.1", | ||
"load-grunt-tasks": "^3.5.2", | ||
"verb": "^0.8.10" | ||
} | ||
} |
@@ -9,2 +9,4 @@ # cfpathcheck | ||
[![Dependency Status](https://david-dm.org/timbeadle/cfpathcheck.svg)](https://david-dm.org/timbeadle/cfpathcheck) | ||
[![devDependency Status](https://david-dm.org/timbeadle/cfpathcheck/dev-status.svg)](https://david-dm.org/timbeadle/cfpathcheck#info=devDependencies) | ||
[![Code Climate](https://codeclimate.com/github/timbeadle/cfpathcheck/badges/gpa.svg)](https://codeclimate.com/github/timbeadle/cfpathcheck) | ||
@@ -11,0 +13,0 @@ ## Installation |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17961
28
7
11
307
Updatedglob@^7.0.5
Updatedlodash@^4.15.0