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

Side by Side Diff: lib/src/validator/pubspec.dart

Issue 1585513002: Get rid of all the library tags. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « lib/src/validator/name.dart ('k') | lib/src/validator/pubspec_field.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library pub.validator.pubspec;
6
7 import 'dart:async'; 5 import 'dart:async';
8 6
9 import 'package:path/path.dart' as p; 7 import 'package:path/path.dart' as p;
10 8
11 import '../entrypoint.dart'; 9 import '../entrypoint.dart';
12 import '../validator.dart'; 10 import '../validator.dart';
13 11
14 /// Validates that a package's pubspec exists. 12 /// Validates that a package's pubspec exists.
15 /// 13 ///
16 /// In most cases this is clearly true, since pub can't run without a pubspec, 14 /// In most cases this is clearly true, since pub can't run without a pubspec,
17 /// but it's possible that the pubspec is gitignored. 15 /// but it's possible that the pubspec is gitignored.
18 class PubspecValidator extends Validator { 16 class PubspecValidator extends Validator {
19 PubspecValidator(Entrypoint entrypoint) 17 PubspecValidator(Entrypoint entrypoint)
20 : super(entrypoint); 18 : super(entrypoint);
21 19
22 Future validate() async { 20 Future validate() async {
23 var files = entrypoint.root.listFiles(recursive: false, useGitIgnore: true); 21 var files = entrypoint.root.listFiles(recursive: false, useGitIgnore: true);
24 if (!files.any((file) => p.basename(file) == "pubspec.yaml")) { 22 if (!files.any((file) => p.basename(file) == "pubspec.yaml")) {
25 errors.add("The pubspec is hidden, probably by .gitignore."); 23 errors.add("The pubspec is hidden, probably by .gitignore.");
26 } 24 }
27 } 25 }
28 } 26 }
29 27
OLDNEW
« no previous file with comments | « lib/src/validator/name.dart ('k') | lib/src/validator/pubspec_field.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698