Commit
Combine JsHint and JSCS rule and cleanup excludeFiles. Hack to stop <xml and more than 500 errors. Revert Regex.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -99,16 +99,19 @@ private CompilerResult ProcessResult(Process process, string errorText, string s | |
private void ValidateResult(Process process, string outputFile, string errorText, CompilerResult result) | ||
{ | ||
try | ||
{ /* Temporary hack see; //github.com/mdevils/node-jscs/issues/212 */ | ||
if (process.ExitCode == 0 && !errorText.StartsWith("<?xml version=", StringComparison.CurrentCulture)) | ||
{ | ||
if (process.ExitCode == 0 && | ||
/* Temporary hack see; //github.com/mdevils/node-jscs/issues/212 */ | ||
(!errorText.StartsWith("<?xml version=", StringComparison.CurrentCulture) || | ||
errorText == "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<checkstyle version=\"4.3\">\n</checkstyle>")) | ||
{ | ||
if (!string.IsNullOrEmpty(outputFile)) | ||
result.Result = File.ReadAllText(outputFile); | ||
result.IsSuccess = true; | ||
} | ||
else | ||
{ | ||
result.Errors = ParseErrors(errorText.Replace("\r", "")); | ||
result.Errors = ParseErrors(errorText.Replace("\n", "")); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
ChrisTorng
Author
Owner
|
||
} | ||
} | ||
catch (FileNotFoundException missingFileException) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
"disallowKeywords": ["with"], | ||
"disallowMultipleLineBreaks": true, | ||
"disallowKeywordsOnNewLine": ["else"], | ||
"excludeFiles": ["**/*.min.js", "**/*.debug.js", "**/*.intellisense.js", "**/*-vsdoc.js"], | ||
"excludeFiles": [], | ||
This comment has been minimized.
Sorry, something went wrong.
SLaks
|
||
"validateJSDoc": { | ||
"checkParamNames": true, | ||
"requireParamTypes": true | ||
|
3 comments
on commit da5538a
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.
What I do these days, is trying to do some easy & fast fix, to stop all the problem starting from WE 1.8.
For this PR, I did:
Combine JSHint and JSCS ignore together, so make JsHintReporter into JsLintReporter, add a new parameter compiler, so each time wanna run JSHint or JSCS should use this class, that share the same rule. And while item is not referenced by project, it will not always ignore anymore. User can right click on not referenced js, or File - Open - File or drag, still to see the result of JSHint and JSCS.
For why remove pattern from excludeFiles, I'm thinking about another problem.
New version of WE won't replace the existed config file, right? That means even we push a new version .jscs.json with correct excludeFiles, those pre-existed one will still keep the original "test/data/*.js" one. For make this work done, the easiest and fast way is do it from code. And I think minified/intellisense js will never have any meaning to be Lint. Why should they always keep excludeFiles with these nonsense?
For hack to remove xml item, of cause we should wait for CLI: Incorrect ERRORLEVEL being reported to stdOut #212, but it's over 2/7, when will it release new version? This issue is not urgent to them, but really annoying to WE users. I can remove that hack after final fix is done.
For 500 limit, I just open a new issue Eliminate total error count #238. But are they really consider to accept? Is it high priority? When will they release? But now WE users are facing serious performance problem, generate from opening js for thousands items.
Thinking about all WE 1.8x users, some can figure out to turn "Run on build/save" off. But there are many choose to downgrade, even to disable/uninstall. Maybe some just don't understand why their VS hang on every build, just trying to reinstall VS again. How long should we all wait for JSCS?
All my goal is to have a quick fix as fast as possible. Mainly just stop JSCS to run on minified js, ignore xml item, 500 limit for other big js files. With all these changes, I think we can again use "Run on build/save" happily.
Really hope to have a good enough WE again, for all users. We can push final fix later, but that will not be urgent, cause we already have a good one right now.
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.
For this is my first time to participate to an open source project. Forgive me if break the common rule.
If anyone find a mistake from other's code, should he notify the author to change, or just fix it? Or do you have a private task list, a distributer, everyone will get some tasks to work? Or you have a commander (@madskristensen?) to give you orders?
And this time, WE facing serious problem. Did you all talks before, all agreed to wait for new version of JSCS then start fix? For me, I think that we should not wait for others, we can do some quick hack to stop the mess, push new version as fast as possible. Or I should start a new issue, make sure you all agreed a quick fix is necessary, then I can do it?
Again, forgive me for my first time.
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.
Again, thank you for your contribution; this is a change that we really need (pending a better way to handle ignores).
You haven't done anything particularly wrong; it's just that we still don't have a perfect solution to this issue.
And yes; we can probably use better coordination. :)
Actually, we can put all of this logic into the regex.