Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(467)

Issue 1418333002: OptionsValidator plugin extension and linter service. (Closed)

Created:
5 years, 2 months ago by pquitslund
Modified:
5 years, 1 month ago
Reviewers:
Brian Wilkerson
CC:
reviews_dartlang.org
Base URL:
git@github.com:dart-lang/sdk.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

OptionsValidator plugin extension and linter service. * Adds a new extension point to allow for contributing OptionsValidators. * Adds a new linter 'service' to server that contributes a lint-aware validator. You'll notice that the warning code I added is NOT in `errors.dart`. I did that in anticipation of plugin-specifc warnings living elsewhere. If that's not the right angle, happy to un-do! R=brianwilkerson@google.com Committed: https://github.com/dart-lang/sdk/commit/68dc36a3e73c5303828c0cec9b469e2038bf7a14

Patch Set 1 #

Patch Set 2 : Reorder. #

Total comments: 15

Patch Set 3 : Review feedback. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+206 lines, -16 lines) Patch
M pkg/analysis_server/lib/src/plugin/server_plugin.dart View 2 chunks +8 lines, -0 lines 0 comments Download
A pkg/analysis_server/lib/src/services/linter/linter.dart View 1 chunk +51 lines, -0 lines 0 comments Download
A pkg/analysis_server/test/services/linter/linter_test.dart View 1 2 1 chunk +77 lines, -0 lines 0 comments Download
M pkg/analyzer/lib/plugin/options.dart View 1 2 3 chunks +21 lines, -0 lines 0 comments Download
M pkg/analyzer/lib/src/plugin/options_plugin.dart View 3 chunks +31 lines, -6 lines 0 comments Download
M pkg/analyzer/lib/src/task/options.dart View 4 chunks +17 lines, -9 lines 0 comments Download
M pkg/analyzer/test/src/task/options_test.dart View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 8 (3 generated)
pquitslund
https://codereview.chromium.org/1418333002/diff/20001/pkg/analyzer/lib/src/task/options.dart File pkg/analyzer/lib/src/task/options.dart (right): https://codereview.chromium.org/1418333002/diff/20001/pkg/analyzer/lib/src/task/options.dart#newcode109 pkg/analyzer/lib/src/task/options.dart:109: // TODO(pq): move to an extension point. If we're ...
5 years, 2 months ago (2015-10-23 22:03:46 UTC) #3
Brian Wilkerson
LGTM https://codereview.chromium.org/1418333002/diff/20001/pkg/analysis_server/lib/src/plugin/server_plugin.dart File pkg/analysis_server/lib/src/plugin/server_plugin.dart (right): https://codereview.chromium.org/1418333002/diff/20001/pkg/analysis_server/lib/src/plugin/server_plugin.dart#newcode328 pkg/analysis_server/lib/src/plugin/server_plugin.dart:328: OPTIONS_VALIDATOR_EXTENSION_POINT_ID, new LinterRuleOptionsValidator()); Personally, I'd like to see ...
5 years, 1 month ago (2015-10-24 15:32:17 UTC) #5
pquitslund
Thanks! https://codereview.chromium.org/1418333002/diff/20001/pkg/analysis_server/lib/src/plugin/server_plugin.dart File pkg/analysis_server/lib/src/plugin/server_plugin.dart (right): https://codereview.chromium.org/1418333002/diff/20001/pkg/analysis_server/lib/src/plugin/server_plugin.dart#newcode328 pkg/analysis_server/lib/src/plugin/server_plugin.dart:328: OPTIONS_VALIDATOR_EXTENSION_POINT_ID, new LinterRuleOptionsValidator()); On 2015/10/24 15:32:17, Brian Wilkerson ...
5 years, 1 month ago (2015-10-26 15:48:59 UTC) #6
pquitslund
Committed patchset #3 (id:40001) manually as 68dc36a3e73c5303828c0cec9b469e2038bf7a14 (presubmit successful).
5 years, 1 month ago (2015-10-26 15:50:58 UTC) #7
Brian Wilkerson
5 years, 1 month ago (2015-10-26 16:07:14 UTC) #8
Message was sent while issue was closed.
https://codereview.chromium.org/1418333002/diff/20001/pkg/analysis_server/lib...
File pkg/analysis_server/lib/src/plugin/server_plugin.dart (right):

https://codereview.chromium.org/1418333002/diff/20001/pkg/analysis_server/lib...
pkg/analysis_server/lib/src/plugin/server_plugin.dart:328:
OPTIONS_VALIDATOR_EXTENSION_POINT_ID, new LinterRuleOptionsValidator());
> My thinking is that we don't since it would add a dependency from analyzer to
linter.

I agree. We don't want that dependency. But that makes me suspect that we need
to move some code from 'linter' to 'analyzer' as well. Definitely a task for
later.

https://codereview.chromium.org/1418333002/diff/20001/pkg/analyzer/lib/plugin...
File pkg/analyzer/lib/plugin/options.dart (right):

https://codereview.chromium.org/1418333002/diff/20001/pkg/analyzer/lib/plugin...
pkg/analyzer/lib/plugin/options.dart:9: import 'package:analyzer/analyzer.dart';
> Maybe we should cook up a lint for this? Or maybe it doesn't come up often
enough?

I suspect that this doesn't come up very often. It's generally only a problem if
a type is made visible from two or more public libraries (and because of
history, that isn't the case here), which probably doesn't happen very often.
And even then, it isn't clear that it would matter which one it was imported
from. I think this is just a weird case.

https://codereview.chromium.org/1418333002/diff/20001/pkg/analyzer/lib/plugin...
pkg/analyzer/lib/plugin/options.dart:76: ///
> Do you have a doc anywhere with these guidelines?

No. We've been discussing the possibility of adding annotations in place of, or
in addition to, these comments.

> If not, maybe added to the CONTRIBUTING doc?

Maybe. Is it normally customized? It looks like boiler-plate to me.

https://codereview.chromium.org/1418333002/diff/20001/pkg/analyzer/lib/src/ta...
File pkg/analyzer/lib/src/task/options.dart (right):

https://codereview.chromium.org/1418333002/diff/20001/pkg/analyzer/lib/src/ta...
pkg/analyzer/lib/src/task/options.dart:109: // TODO(pq): move to an extension
point.
> When we're happy with the extension point we can discuss whether
> we want the ceremony of registering them via a plugin contribution.  

I'm not sure we need to wait until we're happy with it (and it's part of the
public API now, so I hope we're happy with it).

> I'm inclined to for consistency.  What do you think?

I think we should use the plugin support where ever its reasonable (and I think
it's reasonable here).

Powered by Google App Engine
This is Rietveld 408576698