Skip to content

Canonicalization scorer #1455

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 24 commits into from
Jun 13, 2017
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
c213186
First stab at disambiguation, but needs to be extracted
jcollins-g Apr 13, 2017
1dab2d0
update from head
jcollins-g May 16, 2017
787d4f8
scorer in pretty good shape now
jcollins-g May 17, 2017
bddeab3
Merge branch 'master' of github.com:dart-lang/dartdoc into canonicali…
jcollins-g May 19, 2017
13717b5
beginnings of being able to set canonicalization manually
jcollins-g May 22, 2017
004265c
Merge branch 'master' of github.com:dart-lang/dartdoc into canonicali…
jcollins-g May 23, 2017
2ef88ba
intermediate state: moving to library-based canonicalFor declaration
jcollins-g May 23, 2017
6258331
Merge branch 'master' of github.com:dart-lang/dartdoc into canonicali…
jcollins-g Jun 2, 2017
5fa4ca1
intermediate state -- autoinclude deps broken
jcollins-g Jun 2, 2017
4dedc21
intermediate: tests written and working
jcollins-g Jun 2, 2017
7d307a9
test really works now.
jcollins-g Jun 2, 2017
899eb15
regen test docs
jcollins-g Jun 2, 2017
7fa1209
Add new test doc directories
jcollins-g Jun 2, 2017
24e883f
dartfmt
jcollins-g Jun 2, 2017
c3de1bd
Comment typo.
jcollins-g Jun 2, 2017
d997568
Fix --auto-include-deps
jcollins-g Jun 5, 2017
7ed0790
cleanup
jcollins-g Jun 5, 2017
5bfff11
rebuild docs
jcollins-g Jun 5, 2017
abf875f
Helper moved with the fix.
jcollins-g Jun 5, 2017
e16af38
Hide the debug option for the scorer confidence
jcollins-g Jun 5, 2017
8e880c4
Remove unnecessary casts
jcollins-g Jun 5, 2017
a69203a
Implement review comments and extract namePieces into Nameable
jcollins-g Jun 6, 2017
9fe85f8
Merge branch 'master' of github.com:dart-lang/dartdoc into canonicali…
jcollins-g Jun 13, 2017
bc47ab2
Regenerate docs
jcollins-g Jun 13, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions bin/dartdoc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -152,21 +152,21 @@ main(List<String> arguments) async {
generator.onFileCreated.listen(_onProgress);
}

var addCrossdart = args['add-crossdart'] as bool;
var includeSource = args['include-source'] as bool;

DartSdk sdk = new FolderBasedDartSdk(PhysicalResourceProvider.INSTANCE,
PhysicalResourceProvider.INSTANCE.getFolder(sdkDir.path));

setConfig(
addCrossdart: addCrossdart,
addCrossdart: args['add-crossdart'] as bool,
Copy link
Member

Choose a reason for hiding this comment

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

I'm curious if the analyzer needs this casting - do you get a warning without the as bool?

examplePathPrefix: args['example-path-prefix'],
showWarnings: args['show-warnings'],
includeSource: includeSource,
includeSource: args['include-source'] as bool,
inputDir: inputDir,
sdkVersion: sdk.sdkVersion,
autoIncludeDependencies: args['auto-include-dependencies'],
categoryOrder: args['category-order']);
categoryOrder: args['category-order'],
reexportMinConfidence:
double.parse(args['ambiguous-reexport-scorer-min-confidence']),
verboseWarnings: args['verbose-warnings'] as bool);

DartDoc dartdoc = new DartDoc(inputDir, excludeLibraries, sdkDir, generators,
outputDir, packageMeta, includeLibraries,
Expand Down Expand Up @@ -266,6 +266,14 @@ ArgParser _createArgsParser() {
"Generates `index.json` with indentation and newlines. The file is larger, but it's also easier to diff.",
negatable: false,
defaultsTo: false);
parser.addOption('ambiguous-reexport-scorer-min-confidence',
Copy link
Member

Choose a reason for hiding this comment

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

This seems like a super long name for a flag. Is this even a flag that user's should toggle? Should we just decide on a good value for this?

If you need a flag for dev purposes, you can have a hidden option with the hide: true param.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added hide: true.

help:
'Minimum scorer confidence to suppress warning on ambiguous reexport.',
defaultsTo: "0.1");
parser.addFlag('verbose-warnings',
help: 'Display extra debugging information and help with warnings.',
negatable: true,
defaultsTo: true);
return parser;
}

Expand Down
14 changes: 11 additions & 3 deletions lib/src/config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ class Config {
final String sdkVersion;
final bool autoIncludeDependencies;
final List<String> categoryOrder;
final double reexportMinConfidence;
final bool verboseWarnings;
Config._(
this.inputDir,
this.showWarnings,
Expand All @@ -24,7 +26,9 @@ class Config {
this.includeSource,
this.sdkVersion,
this.autoIncludeDependencies,
this.categoryOrder);
this.categoryOrder,
this.reexportMinConfidence,
this.verboseWarnings);
}

Config _config;
Expand All @@ -38,7 +42,9 @@ void setConfig(
bool includeSource: true,
String sdkVersion,
bool autoIncludeDependencies: false,
List<String> categoryOrder}) {
List<String> categoryOrder,
double reexportMinConfidence: 0.1,
verboseWarnings: true}) {
if (categoryOrder == null) {
categoryOrder = new UnmodifiableListView<String>([]);
}
Expand All @@ -50,5 +56,7 @@ void setConfig(
includeSource,
sdkVersion,
autoIncludeDependencies,
categoryOrder);
categoryOrder,
reexportMinConfidence,
verboseWarnings);
}
1 change: 0 additions & 1 deletion lib/src/markdown_processor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
library dartdoc.markdown_processor;

import 'dart:convert';
import 'dart:io';
import 'dart:math';

import 'package:analyzer/dart/ast/ast.dart';
Expand Down
Loading