Unless you are run in silent mode, console reporter will be used, regardless of other configured reporters:
|
if (!options.silent) { |
|
detector.registerSubscriber(new ProgressSubscriber(options)); |
|
} |
|
CLONE_FOUND: (payload: IEventPayload): void => cloneFound(payload.clone as IClone, this.options), |
In my configuration, I have reporters: ['consoleFull'] set. However, this creates a duplication - the console reporter prints location of all detections, and then consoleFull does it again (but with more detail)
Could this be made a bit nicer?
- make ProgressReporter use consoleFull rather than console if consoleFull reporter is enabled?
- OR add this table to consoleFull reporter too, and print it even in silent mode:
|
if (statistic && !this.options.silent) { |
|
const table = new Table({ |
|
head: ['Format', 'Files analyzed', 'Total lines', 'Total tokens', 'Clones found', 'Duplicated lines', 'Duplicated tokens'], |
|
}); |
|
|
. This way, silent:true can be enabled to prevent ProgressReporter from creating duplicate messages
- Remove
consoleFull reporter in favor of adding reporterOptions to console reporter
What I see as an ideal outcome:
- I have a console report, with code snippets, and a summary table
- What it streams in incrementally or appears at all once doesn't matter much
Unless you are run in silent mode, console reporter will be used, regardless of other configured reporters:
jscpd/apps/jscpd/src/init/subscribers.ts
Lines 9 to 11 in d9584f2
jscpd/packages/finder/src/subscribers/progress.ts
Line 11 in d9584f2
In my configuration, I have
reporters: ['consoleFull']set. However, this creates a duplication - the console reporter prints location of all detections, and then consoleFull does it again (but with more detail)Could this be made a bit nicer?
jscpd/packages/finder/src/reporters/console.ts
Lines 16 to 20 in d9584f2
consoleFullreporter in favor of adding reporterOptions toconsolereporterWhat I see as an ideal outcome: