Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Fixing bug where the worker thread would hang if there wasn't a tslint.json file #160

Merged
merged 5 commits into from
Apr 25, 2017

Conversation

Xapphire13
Copy link
Contributor

@Xapphire13 Xapphire13 commented Apr 25, 2017

Two issues in one:

Firstly, there was a regression I caused when copying the rulesDirectory code over to worker.js in #158. I missed the fact it used to refer to this. (which is now config.), so a circular reference was caused, which led tslint to have kittens, leading to the worker hanging.

Secondly, if tslint hit an issue, it would cause the worker to hang.

@Xapphire13 Xapphire13 added the bug label Apr 25, 2017
lib/worker.js Outdated
linter.lint(filePath, content, configuration);
lintResult = linter.getResult();
} catch (err) {
lintResult = {};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't something be done with this crash? (Logging to the console?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, will add =]


it('validates even when there is no tslint.json', () => {
waitsForPromise(() =>
atom.workspace.open(noConfigPath).then(editor => lint(editor)),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the results be checked?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really sure. In this test I don't care that the file was accurately validated, nor the specific results, I just want to make sure that validation completed

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If that's all that was needed for the test, that's good enough for me.

Copy link
Member

@Arcanemagus Arcanemagus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inexplicably this line is blowing up and literally taking forever when configurationPath is null, which is the case in this new spec.

I'd recommend just adding && configurationPath to the conditionals of the if on the line above, as the entire block doesn't make a lot of sense if you have no configuration.

@@ -1,50 +1,48 @@
'use babel';

import * as path from 'path';
import { beforeEach, it } from 'jasmine-fix'; // eslint-disable-line import/no-extraneous-dependencies
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put a note here about fit, with async specs if you try to use fit without importing it the spec will "pass" but do nothing.

@Xapphire13 Xapphire13 merged commit 01a482b into master Apr 25, 2017
@Xapphire13 Xapphire13 deleted the rulesFix branch April 25, 2017 22:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants