Skip to content

Conversation

@damccorm
Copy link
Contributor

@damccorm damccorm commented Jan 18, 2019

I currently am trying to add CI to sindresorhus/awesome using Azure Pipelines, and I would like to use a custom reporter so that I can display test results in the Pipelines test UI. This PR enables that by adding support for custom reporters.

PR here: sindresorhus/awesome#1505

@damccorm
Copy link
Contributor Author

@sindresorhus @transitive-bullshit could you take a look at this?

index.js Outdated

file.path = path.basename(file.path);
console.log(vfileReporterPretty([file]));
if (options.customReporter) {
Copy link
Owner

Choose a reason for hiding this comment

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

The option name can simply be named reporter.

index.js Outdated
console.log(options.customReporter([file]));
} else {
console.log(vfileReporterPretty([file]));
}
Copy link
Owner

Choose a reason for hiding this comment

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

Can be simplified to:

const reporter = options.reporter || vfileReporterPretty;
console.log(reporter([file]));

package.json Outdated
{
"name": "awesome-lint",
"version": "0.8.0",
"version": "0.9.0",
Copy link
Owner

Choose a reason for hiding this comment

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

Don't bump version in a pull request. It's up to the maintainers when, how, and what version to bump :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, my apologies, that makes sense.

@sindresorhus
Copy link
Owner

Yeah, makes sense to have this. The option must be documented in the readme and needs a test in https://github.com/sindresorhus/awesome-lint/blob/master/test/cli.js

@sindresorhus sindresorhus changed the title Allow user to pass in custom reporter Add reporter option Feb 11, 2019
@sindresorhus
Copy link
Owner

It should be exposed as a CLI flag too.

@damccorm
Copy link
Contributor Author

@sindresorhus I went ahead and responded to all feedback, let me know if you think there's any additional work to do before merging.

@sindresorhus
Copy link
Owner

Looks good :)

@sindresorhus sindresorhus merged commit 9d12b8f into sindresorhus:master Feb 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants