-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Up deps, fix vuls, update fixtures #18
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
node_modules/ | ||
yarn.lock | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,8 +29,8 @@ exports._parse = function (argv, _console, callback) { | |
DEFAULT_SLEEP_MS) | ||
.option('--concurrency <concurrency>', | ||
'Amount of requests to run in parallel, defaults to ' + DEFAULT_CONCURRENCY, DEFAULT_CONCURRENCY) | ||
.option('--usermedium <usermedium>', 'Medium where the CSS will be used (e.g. `all` (service default), `print`, `screen`)') | ||
.option('--profile <profile>', 'CSS profile to use for validation (e.g. `css3svg` (service default), `css21`, `svg`)') | ||
.option('--usermedium <usermedium>', 'Medium where the CSS will be used (e.g. `all` (service default), `print`, `screen`)') // jscs:disable | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm guessing this is for line length, would prefer we silence that rule explicitly. Will update |
||
.option('--profile <profile>', 'CSS profile to use for validation (e.g. `css3svg` (service default), `css21`, `svg`)') // jscs:disable | ||
.option('--lang <lang>', 'Language to use in response (e.g. `en` (service default), `bg`, `de`)') | ||
.option('--warning <warning>', 'Warning level to set (e.g. `0`, `1`, `2` (service default), `no`)') | ||
.option('--vextwarning <vextwarning>', | ||
|
@@ -40,6 +40,9 @@ exports._parse = function (argv, _console, callback) { | |
// Process our arguments | ||
program.parse(argv); | ||
|
||
// Get program opts | ||
var opts = program.opts(); | ||
|
||
// Assume we are OK by default | ||
var status = STATUS_OK; | ||
|
||
|
@@ -54,17 +57,17 @@ exports._parse = function (argv, _console, callback) { | |
} | ||
|
||
// Otherwise, perform our validation | ||
async.eachOfLimit(filepathContentArr, program.concurrency, | ||
async.eachOfLimit(filepathContentArr, opts.concurrency, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Was confused why we needed this change -- turns out in Commander@7 they moved it to an inner object to avoid unsafe usage: |
||
function handleFilepathContent (filepathContent, i, cb) { | ||
var filepath = filepaths[i]; | ||
var options = { | ||
text: filepathContent, | ||
w3cUrl: program.w3cUrl, | ||
usermedium: program.usermedium, | ||
profile: program.profile, | ||
lang: program.lang, | ||
warning: program.warning, | ||
vextwarning: program.vextwarning | ||
w3cUrl: opts.w3cUrl, | ||
usermedium: opts.usermedium, | ||
profile: opts.profile, | ||
lang: opts.lang, | ||
warning: opts.warning, | ||
vextwarning: opts.vextwarning | ||
}; | ||
|
||
validateCss(options, function handleValidateCss (err, data) { | ||
|
@@ -96,7 +99,7 @@ exports._parse = function (argv, _console, callback) { | |
} | ||
|
||
// Continue | ||
setTimeout(cb, program.sleep); | ||
setTimeout(cb, opts.delay); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 Nice catch, surprised nobody reported this earlier o_o |
||
}); | ||
}, function handleResults (err) { | ||
// If there was an error, callback with it | ||
|
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
"request": { | ||
"httpVersion": "1.1", | ||
"headers": { | ||
"host": "localhost:1337", | ||
"connection": "close" | ||
}, | ||
"trailers": {}, | ||
"method": "GET", | ||
"url": "/css-validator/validator?output=soap12&w3cUrl=http%3A%2F%2Flocalhost%3A1337%2Fcss-validator%2Fvalidator&uri=https%3A%2F%2Fgitcdn.link%2Frepo%2Ftwolfson%2Fcss-validator%2F0.7.0%2Ftest%2Ftest-files%2Fvalid.css", | ||
"bodyEncoding": "utf8", | ||
"body": "" | ||
}, | ||
"response": { | ||
"httpVersion": "1.1", | ||
"headers": { | ||
"cache-control": "no-cache", | ||
"date": "Sun, 07 Mar 2021 10:21:41 GMT", | ||
"pragma": "no-cache", | ||
"transfer-encoding": "chunked", | ||
"content-language": "en", | ||
"content-type": "application/soap+xml;charset=utf-8", | ||
"server": "Jigsaw/2.3.0-beta3", | ||
"vary": "Accept-Language", | ||
"access-control-allow-origin": "*", | ||
"access-control-allow-headers": "content-type,accept-charset", | ||
"access-control-allow-methods": "GET, HEAD, POST, OPTIONS", | ||
"access-control-max-age": "600", | ||
"x-w3c-validator-errors": "0", | ||
"x-w3c-validator-status": "Valid", | ||
"connection": "close" | ||
}, | ||
"trailers": {}, | ||
"statusCode": 200, | ||
"bodyEncoding": "utf8", | ||
"body": "<?xml version='1.0' encoding=\"utf-8\"?>\n<env:Envelope xmlns:env=\"http://www.w3.org/2003/05/soap-envelope\">\n <env:Body>\n <m:cssvalidationresponse\n env:encodingStyle=\"http://www.w3.org/2003/05/soap-encoding\"\n xmlns:m=\"http://www.w3.org/2005/07/css-validator\">\n <m:uri>https://gitcdn.link/repo/twolfson/css-validator/0.7.0/test/test-files/valid.css</m:uri>\n <m:checkedby>http://jigsaw.w3.org/css-validator/</m:checkedby>\n <m:csslevel>css3</m:csslevel>\n <m:date>2021-03-07T10:21:41Z</m:date>\n <m:validity>true</m:validity>\n <m:result>\n <m:errors xml:lang=\"en\">\n <m:errorcount>0</m:errorcount>\n \n </m:errors>\n <m:warnings xml:lang=\"en\">\n <m:warningcount>0</m:warningcount>\n </m:warnings>\n </m:result>\n </m:cssvalidationresponse>\n </env:Body>\n</env:Envelope>\n\n" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
"request": { | ||
"httpVersion": "1.1", | ||
"headers": { | ||
"host": "localhost:1337", | ||
"connection": "close" | ||
}, | ||
"trailers": {}, | ||
"method": "GET", | ||
"url": "/css-validator/validator?output=soap12&w3cUrl=http%3A%2F%2Flocalhost%3A1337%2Fcss-validator%2Fvalidator&uri=https%3A%2F%2Fgitcdn.link%2Frepo%2Ftwolfson%2Fcss-validator%2F0.7.0%2Ftest%2Ftest-files%2Finvalid.css", | ||
"bodyEncoding": "utf8", | ||
"body": "" | ||
}, | ||
"response": { | ||
"httpVersion": "1.1", | ||
"headers": { | ||
"cache-control": "no-cache", | ||
"date": "Sun, 07 Mar 2021 10:21:01 GMT", | ||
"pragma": "no-cache", | ||
"transfer-encoding": "chunked", | ||
"content-language": "en", | ||
"content-type": "application/soap+xml;charset=utf-8", | ||
"server": "Jigsaw/2.3.0-beta3", | ||
"vary": "Accept-Language", | ||
"access-control-allow-origin": "*", | ||
"access-control-allow-headers": "content-type,accept-charset", | ||
"access-control-allow-methods": "GET, HEAD, POST, OPTIONS", | ||
"access-control-max-age": "600", | ||
"x-w3c-validator-errors": "1", | ||
"x-w3c-validator-status": "Invalid", | ||
"connection": "close" | ||
}, | ||
"trailers": {}, | ||
"statusCode": 200, | ||
"bodyEncoding": "utf8", | ||
"body": "<?xml version='1.0' encoding=\"utf-8\"?>\n<env:Envelope xmlns:env=\"http://www.w3.org/2003/05/soap-envelope\">\n <env:Body>\n <m:cssvalidationresponse\n env:encodingStyle=\"http://www.w3.org/2003/05/soap-encoding\"\n xmlns:m=\"http://www.w3.org/2005/07/css-validator\">\n <m:uri>https://gitcdn.link/repo/twolfson/css-validator/0.7.0/test/test-files/invalid.css</m:uri>\n <m:checkedby>http://jigsaw.w3.org/css-validator/</m:checkedby>\n <m:csslevel>css3</m:csslevel>\n <m:date>2021-03-07T10:21:02Z</m:date>\n <m:validity>false</m:validity>\n <m:result>\n <m:errors xml:lang=\"en\">\n <m:errorcount>1</m:errorcount>\n \n <m:errorlist>\n <m:uri>https://gitcdn.link/cdn/twolfson/css-validator/b694a83b93fa9ffb2150dd2fbab75223a49b3bd2/test/test-files/invalid.css</m:uri>\n \n <m:error>\n <m:line>2</m:line>\n <m:errortype>parse-error</m:errortype>\n <m:context>body</m:context> \n <m:errorsubtype>\n exp\n </m:errorsubtype>\n <m:skippedstring>\n url(ab 'cd')\n </m:skippedstring>\n <m:type>value</m:type>\n \n <m:message>\n \n Value Error : background (nullcolors.html#propdef-background)\n \n “url(ab 'cd')” is not a “background-color” value : \n </m:message>\n </m:error>\n \n </m:errorlist>\n \n </m:errors>\n <m:warnings xml:lang=\"en\">\n <m:warningcount>1</m:warningcount>\n \n <m:warninglist>\n <m:uri>https://gitcdn.link/cdn/twolfson/css-validator/b694a83b93fa9ffb2150dd2fbab75223a49b3bd2/test/test-files/invalid.css</m:uri>\n \n <m:warning>\n <m:line>3</m:line>\n <m:level>0</m:level>\n <m:message>“-moz-box-sizing” is an unknown vendor extension</m:message>\n <m:type>vendor-extension</m:type>\n </m:warning>\n \n </m:warninglist>\n </m:warnings>\n </m:result>\n </m:cssvalidationresponse>\n </env:Body>\n</env:Envelope>\n\n" | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't use Yarn in this repo so shouldn't really need this =/ This seems like it should be in the developer's global
.gitignore
-- or they should usenpm install
Will leave it though I guess, doesn't really hurt anyone, though might confuse them