Enable avoid_redundant_argument_values lint (#91409)

This commit is contained in:
Ian Hickson
2021-10-07 20:13:02 -07:00
committed by GitHub
parent 4bf7179e51
commit 5fd259be24
667 changed files with 1693 additions and 3385 deletions

View File

@@ -132,7 +132,6 @@ Future<void> main(List<String> rawArguments) async {
);
argParser.addFlag(
'collect',
defaultsTo: false,
negatable: false,
help: 'If this flag is set, then collect and parse header files from '
'Chromium and Android instead of reading pre-parsed data from '
@@ -141,7 +140,6 @@ Future<void> main(List<String> rawArguments) async {
);
argParser.addFlag(
'help',
defaultsTo: false,
negatable: false,
help: 'Print help for this command.',
);

View File

@@ -22,7 +22,7 @@ class MaskConstant {
return name
.split(' ')
.map<String>((String word) => lowerCamelToUpperCamel(word.toLowerCase()))
.join('');
.join();
}
String get lowerCamelName {

View File

@@ -81,7 +81,7 @@ class IOSCodeGenerator extends PlatformCodeGenerator {
buffer.write(wrapString(constant.description, prefix: ' * '));
buffer.writeln(' */');
buffer.writeln('const uint64_t k${constant.upperCamelName} = ${toHex(constant.value, digits: 11)};');
buffer.writeln('');
buffer.writeln();
}
return buffer.toString().trimRight();
}

View File

@@ -61,7 +61,7 @@ class KeyboardKeysCodeGenerator extends BaseCodeGenerator {
'[RawKeyEvent.physicalKey] for more information.');
lines.add(entry.usbHidCode, '''
$firstComment ///
$otherComments static const PhysicalKeyboardKey ${entry.constantName} = PhysicalKeyboardKey(${toHex(entry.usbHidCode, digits: 8)});
$otherComments static const PhysicalKeyboardKey ${entry.constantName} = PhysicalKeyboardKey(${toHex(entry.usbHidCode)});
''');
}
return lines.sortedJoin().trimRight();
@@ -71,7 +71,7 @@ $otherComments static const PhysicalKeyboardKey ${entry.constantName} = Physica
final OutputLines<int> lines = OutputLines<int>('Physical debug names');
for (final PhysicalKeyEntry entry in keyData.entries) {
lines.add(entry.usbHidCode, '''
${toHex(entry.usbHidCode, digits: 8)}: '${entry.commentName}',''');
${toHex(entry.usbHidCode)}: '${entry.commentName}',''');
}
return lines.sortedJoin().trimRight();
}

View File

@@ -23,7 +23,7 @@ class KeyCodesCcGenerator extends BaseCodeGenerator {
final OutputLines<int> lines = OutputLines<int>('Physical Key list');
for (final PhysicalKeyEntry entry in keyData.entries) {
lines.add(entry.usbHidCode, '''
constexpr uint64_t kPhysical${_toUpperCammel(entry.constantName)} = ${toHex(entry.usbHidCode, digits: 8)};''');
constexpr uint64_t kPhysical${_toUpperCammel(entry.constantName)} = ${toHex(entry.usbHidCode)};''');
}
return lines.sortedJoin().trimRight();
}