Trivial nit fixes (#12285)

This commit is contained in:
Ian Hickson
2017-09-27 16:13:48 -07:00
committed by GitHub
parent 4389f07024
commit efb45ea788
44 changed files with 90 additions and 92 deletions

View File

@@ -118,11 +118,7 @@ class AnsiTerminal {
}
String choice;
singleCharMode = true;
while(
isEmpty(choice)
|| choice.length != 1
|| !acceptedCharacters.contains(choice)
) {
while (isEmpty(choice) || choice.length != 1 || !acceptedCharacters.contains(choice)) {
if (isNotEmpty(prompt)) {
printStatus(prompt, emphasis: true, newline: false);
if (displayAcceptedCharacters)

View File

@@ -53,8 +53,8 @@ abstract class AnalyzeBase {
bool get isBenchmarking => argResults['benchmark'];
}
/// Return `true` if [fileList] contains a path that resides inside the Flutter repository.
/// If [fileList] is empty, then return `true` if the current directory resides inside the Flutter repository.
/// Return true if [fileList] contains a path that resides inside the Flutter repository.
/// If [fileList] is empty, then return true if the current directory resides inside the Flutter repository.
bool inRepo(List<String> fileList) {
if (fileList == null || fileList.isEmpty)
fileList = <String>[fs.path.current];

View File

@@ -383,7 +383,7 @@ String _validateProjectDir(String dirPath, { String flutterRoot }) {
final FileSystemEntityType type = fs.typeSync(dirPath);
if (type != FileSystemEntityType.NOT_FOUND) {
switch(type) {
switch (type) {
case FileSystemEntityType.FILE:
// Do not overwrite files.
return "Invalid project name: '$dirPath' - file exists.";

View File

@@ -109,7 +109,7 @@ class ResidentCompiler {
/// Otherwise, [mainPath] is ignored, but [invalidatedFiles] is recompiled
/// into new binary.
/// Binary file name is returned if compilation was successful, otherwise
/// `null` is returned.
/// null is returned.
Future<String> recompile(String mainPath, List<String> invalidatedFiles) async {
stdoutHandler.reset();

View File

@@ -30,7 +30,7 @@ DevFSConfig get devFSConfig => context[DevFSConfig];
abstract class DevFSContent {
bool _exists = true;
/// Return `true` if this is the first time this method is called
/// Return true if this is the first time this method is called
/// or if the entry has been modified since this method was last called.
bool get isModified;
@@ -125,7 +125,7 @@ class DevFSByteContent extends DevFSContent {
_isModified = true;
}
/// Return `true` only once so that the content is written to the device only once.
/// Return true only once so that the content is written to the device only once.
@override
bool get isModified {
final bool modified = _isModified;

View File

@@ -668,12 +668,12 @@ int compareIosVersions(String v1, String v2) {
final List<int> v2Fragments = v2.split('.').map(int.parse).toList();
int i = 0;
while(i < v1Fragments.length && i < v2Fragments.length) {
while (i < v1Fragments.length && i < v2Fragments.length) {
final int v1Fragment = v1Fragments[i];
final int v2Fragment = v2Fragments[i];
if (v1Fragment != v2Fragment)
return v1Fragment.compareTo(v2Fragment);
i++;
i += 1;
}
return v1Fragments.length.compareTo(v2Fragments.length);
}

View File

@@ -395,7 +395,7 @@ class VersionCheckError implements Exception {
/// Runs [command] and returns the standard output as a string.
///
/// If [lenient] is `true` and the command fails, returns an empty string.
/// If [lenient] is true and the command fails, returns an empty string.
/// Otherwise, throws a [ToolExit] exception.
String _runSync(List<String> command, {bool lenient: true}) {
final ProcessResult results = processManager.runSync(command, workingDirectory: Cache.flutterRoot);