-
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Allow GScan to scan different versions
closes #116 - CLI - Added `-1, --v1` option to allow cli usage of GScan to check for 1.0 theme compatibility - Passed `options` that includes a `checkVersion` property, which is set to `v1` when cli called with `-1`, or `latest` by default. - Restructure current specs - created a new `/specs` directory - renamed current `spec.js` to `v1.js` - duplicated current `spec.js` to `latest.js` -> will contain only differences later - the latest version will inherit the ruleset from `v1`, but overwrite properties that exist in both - App - Offered a select box with the - currently - two accepted versions, whereas the latest is set to default - Passed the selected version to gscan - Checks - moveed checks properties (regex, helpername, cssclass) to the rules in spec - useed list of rules to specify which rules have to run for each version (concat them, if applicable) - require the version of the spec that we need for the checks only
- Loading branch information
Showing
24 changed files
with
947 additions
and
641 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,28 @@ | ||
var Promise = require('bluebird'), | ||
_ = require('lodash'), | ||
requireDir = require('require-dir'), | ||
readTheme = require('./read-theme'), | ||
checker, | ||
checks; | ||
const Promise = require('bluebird'); | ||
const _ = require('lodash'); | ||
const requireDir = require('require-dir'); | ||
const readTheme = require('./read-theme'); | ||
|
||
checks = requireDir('./checks'); | ||
const checks = requireDir('./checks'); | ||
|
||
/** | ||
* Check theme | ||
* | ||
* Takes a theme path, reads the theme, and checks it for issues. | ||
* Returns a theme object. | ||
* @param themePath | ||
* @param options | ||
* @returns {Object} | ||
*/ | ||
checker = function checkAll(themePath, options) { | ||
const checker = function checkAll(themePath, options) { | ||
options = options || {}; | ||
|
||
return readTheme(themePath).then(function (theme) { | ||
return Promise.reduce(_.values(checks), function (theme, check) { | ||
return check(theme, themePath, options); | ||
}, theme); | ||
}); | ||
return readTheme(themePath) | ||
.then(function (theme) { | ||
return Promise.reduce(_.values(checks), function (theme, check) { | ||
return check(theme, options, themePath); | ||
}, theme); | ||
}); | ||
}; | ||
|
||
module.exports = checker; |
Oops, something went wrong.