Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

runner.ts: Break into separate functions #2572

Merged
merged 8 commits into from
May 25, 2017
Merged

Conversation

andy-hanson
Copy link
Contributor

@andy-hanson andy-hanson commented Apr 14, 2017

PR checklist

  • Addresses an existing issue: #0000
  • New feature, bugfix, or enhancement
    • Includes tests
  • Documentation update

Overview of change:

Just a refactor. Breaks apart the class into smaller functions.
Converted it to return a Promise, but the implementation doesn't use Promises yet.

src/runner.ts Outdated
if (this.options.version) {
this.outputStream.write(Linter.VERSION + "\n");
return onComplete(0);
export async function run(options: Options, outputStream: NodeJS.WritableStream): Promise<Status> {
Copy link
Contributor

Choose a reason for hiding this comment

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

While you're in the area, would it make sense to stop using any console messages at all? In addition to passing the CLI options and an outputStream it makes sense to also pass an errorStream.


export interface IRunnerOptions {
export interface Options {
Copy link
Contributor

Choose a reason for hiding this comment

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

breaking. Can you rename back?

src/runner.ts Outdated
if (this.options.version) {
this.outputStream.write(Linter.VERSION + "\n");
return onComplete(0);
export async function run(options: Options, outputStream: NodeJS.WritableStream, errorStream: NodeJS.WritableStream): Promise<Status> {
Copy link
Contributor

Choose a reason for hiding this comment

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

to avoid a breaking change and waiting for 6.0, can you put a Runner class as a wrapper? We can remove it in the next major rev

Copy link
Contributor Author

Choose a reason for hiding this comment

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

According to #2446 (comment), anything not in index is not public.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@nchen63 bump

@adidahiya
Copy link
Contributor

ping here, can you address @nchen63's comments?

@andy-hanson
Copy link
Contributor Author

According to #2446 (comment), anything not in index is not public.

@adidahiya
Copy link
Contributor

fair enough; I assumed it was exported through index.

got a few merge conflicts left though

@adidahiya
Copy link
Contributor

new conflicts with 2bc8982 :(

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants