Skip to content

Commit

Permalink
style(typo): Spell check and correction of words (#780)
Browse files Browse the repository at this point in the history
Co-authored-by: Leo Farias <[email protected]>
  • Loading branch information
charles0122 and leoafarias authored Oct 1, 2024
1 parent af79053 commit 1a4d58b
Show file tree
Hide file tree
Showing 20 changed files with 35 additions and 35 deletions.
2 changes: 1 addition & 1 deletion lib/src/commands/dart_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class DartCommand extends BaseCommand {
CacheFlutterVersion? cacheVersion;

if (version != null) {
// Will install version if not already instaled
// Will install version if not already installed
cacheVersion = await ensureCacheWorkflow(version);

logger
Expand Down
2 changes: 1 addition & 1 deletion lib/src/commands/doctor_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class DoctorCommand extends BaseCommand {

table.insertRow([kIntelliJ]);

// Get localproperties file within flutter project
// Get local properties file within flutter project
final localPropertiesFile =
File(join(project.path, 'android', 'local.properties'));

Expand Down
2 changes: 1 addition & 1 deletion lib/src/commands/exec_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class ExecCommand extends BaseCommand {
CacheFlutterVersion? cacheVersion;

if (version != null) {
// Will install version if not already instaled
// Will install version if not already installed
cacheVersion = await ensureCacheWorkflow(version);
logger
..info('$kPackageName: Running version: "$version"')
Expand Down
2 changes: 1 addition & 1 deletion lib/src/commands/flavor_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class FlavorCommand extends BaseCommand {
// Removes flavor from first arg
final flutterArgs = [...?argResults?.rest]..removeAt(0);

// Will install version if not already instaled
// Will install version if not already installed
final cacheVersion = await ensureCacheWorkflow(version);
// Runs flutter command with pinned version
logger
Expand Down
2 changes: 1 addition & 1 deletion lib/src/commands/spawn_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class SpawnCommand extends BaseCommand {
// Removes version from first arg
final flutterArgs = [...?argResults?.rest]..removeAt(0);

// Will install version if not already instaled
// Will install version if not already installed
final cacheVersion = await ensureCacheWorkflow(version);
// Runs flutter command with pinned version
logger.info('Spawning version "$version"...');
Expand Down
8 changes: 4 additions & 4 deletions lib/src/models/config_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ enum ConfigKeys {
gitCachePath(description: 'Path where local Git reference cache is stored'),
flutterUrl(description: 'Flutter repository Git URL to clone from'),

privilegedAccess(description: 'Enable/Disable priviledged access for FVM');
privilegedAccess(description: 'Enable/Disable privileged access for FVM');

const ConfigKeys({required this.description});

Expand All @@ -38,7 +38,7 @@ enum ConfigKeys {
String get propKey => _recase.camelCase;

static injectArgParser(ArgParser argParser) {
final configKeysFuncs = {
final configKeysFunctions = {
ConfigKeys.cachePath: () {
argParser.addOption(
ConfigKeys.cachePath.paramKey,
Expand Down Expand Up @@ -76,7 +76,7 @@ enum ConfigKeys {
};

for (final key in ConfigKeys.values) {
configKeysFuncs[key]?.call();
configKeysFunctions[key]?.call();
}
}
}
Expand Down Expand Up @@ -135,7 +135,7 @@ class FileConfig extends BaseConfig with FileConfigMappable {

final bool? runPubGetOnSdkChanges;

/// If FVM should run with priviledged access
/// If FVM should run with privileged access
final bool? privilegedAccess;

static final fromMap = FileConfigMapper.fromMap;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/models/flutter_version_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class FlutterVersion with FlutterVersionMappable {
/// Represents the underlying string value of the Flutter version.
final String name;

/// Has a cannel which the version is part of
/// Has a channel which the version is part of
final String? releaseFromChannel;

final VersionType type;
Expand Down
8 changes: 4 additions & 4 deletions lib/src/runner.dart
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,12 @@ class FvmCommandRunner extends CompletionCommandRunner<int> {
if (checkIfNeedsPrivilegePermission(err)) {
logger
..spacer
..fail('Requires administrator priviledges to run this command.')
..fail('Requires administrator privileges to run this command.')
..spacer;

logger.notice(
"You don't have the required priviledges to run this command.\n"
"Try running with sudo or administrator priviledges.\n"
"You don't have the required privileges to run this command.\n"
"Try running with sudo or administrator privileges.\n"
"If you are on Windows, you can turn on developer mode: https://bit.ly/3vxRr2M",
);

Expand All @@ -169,7 +169,7 @@ class FvmCommandRunner extends CompletionCommandRunner<int> {

return e.errorCode;
} on UsageException catch (err) {
// On usagerr errors, show the commands usage message and
// On usage errors, show the commands usage message and
// exit with an error code
logger
..err(err.message)
Expand Down
2 changes: 1 addition & 1 deletion lib/src/services/cache_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class CacheService extends ContextService {
}

/// Moves a [CacheFlutterVersion] to the cache of [sdkVersion]
void moveToSdkVersionDiretory(CacheFlutterVersion version) {
void moveToSdkVersionDirectory(CacheFlutterVersion version) {
final sdkVersion = version.flutterSdkVersion;

if (sdkVersion == null) {
Expand Down
4 changes: 2 additions & 2 deletions lib/src/services/flutter_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,8 @@ class FlutterService extends ContextService {
}
}

class FlutterServiveMock extends FlutterService {
FlutterServiveMock(FVMContext context) : super(context);
class FlutterServiceMock extends FlutterService {
FlutterServiceMock(FVMContext context) : super(context);

@override
Future<void> install(
Expand Down
4 changes: 2 additions & 2 deletions lib/src/services/logger_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ class ConsoleController {
/// stdout stream
final stdout = StreamController<List<int>>();

/// sderr stream
/// stderr stream
final stderr = StreamController<List<int>>();

/// warning stream
Expand All @@ -150,7 +150,7 @@ class ConsoleController {
/// fine stream
final fine = StreamController<List<int>>();

/// info streamm
/// info stream
final info = StreamController<List<int>>();

/// error stream
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class FlutterReleasesResponse with FlutterReleasesResponseMappable {

/// Goes through the current_release payload.
/// Finds the proper release base on the hash
/// Assings to the current_release
/// Assigns to the current_release
FlutterReleasesResponse _parseCurrentReleases(Map<String, dynamic> map) {
final baseUrl = map['base_url'] as String;
final currentRelease = map['current_release'] as Map<String, dynamic>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class Channels with ChannelsMappable {
static final fromMap = ChannelsMapper.fromMap;
static final fromJson = ChannelsMapper.fromJson;

/// Channel model contructor
/// Channel model constructor
const Channels({required this.beta, required this.dev, required this.stable});

/// Returns a list of all releases
Expand Down
2 changes: 1 addition & 1 deletion lib/src/services/releases_service/releases_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ String get storageUrl {
String _getFlutterReleasesUrl(String platform) =>
'$storageUrl/flutter_infra_release/releases/releases_$platform.json';

/// Returns a CDN cached version of the releaes per platform
/// Returns a CDN cached version of the releases per platform
String _getGithubCacheUrl(String platform) {
return _envVars['FLUTTER_RELEASES_URL'] ??
'https://raw.githubusercontent.com/leoafarias/fvm/main/releases_$platform.json';
Expand Down
4 changes: 2 additions & 2 deletions lib/src/utils/change_case.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const _snakeCaseSeparator = '_';
const _paramCaseSeparator = '-';
const _spaceSeparator = ' ';
const _nospaceSeparator = '';
const _noSpaceSeparator = '';
final RegExp _upperAlphaRegex = RegExp(r'[A-Z]');

final _symbolSet = {
Expand Down Expand Up @@ -49,7 +49,7 @@ class ChangeCase {
words[0] = words[0].toLowerCase();
}

return words.join(_nospaceSeparator);
return words.join(_noSpaceSeparator);
}

String _uppercase(String separator) => _words.uppercase.join(separator);
Expand Down
4 changes: 2 additions & 2 deletions lib/src/utils/console_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ String cacheVersionSelector(List<CacheFlutterVersion> versions) {
final versionsList = versions.map((version) => version.name).toList();

final choise = logger.select('Select a version: ', options: versionsList);
final choice = logger.select('Select a version: ', options: versionsList);

return choise;
return choice;
}
4 changes: 2 additions & 2 deletions lib/src/utils/context.dart
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class FVMContext with FVMContextMappable {

@MappableField()
String get gitCachePath {
// If git cache is not overriden use default based on fvmDir
// If git cache is not override use default based on fvmDir
if (config.gitCachePath != null) return config.gitCachePath!;

return join(fvmDir, 'cache.git');
Expand All @@ -171,7 +171,7 @@ class FVMContext with FVMContextMappable {
: false;
}

/// Priviledged access
/// Privileged access
@MappableField()
bool get privilegedAccess {
return config.privilegedAccess != null ? config.privilegedAccess! : true;
Expand Down
4 changes: 2 additions & 2 deletions lib/src/utils/parsers/git_clone_update_printer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ void updateProgress(String line) {
if (matchedEntry != null) {
final label = matchedEntry.key.padRight(maxLabelLength);
final match = matchedEntry.value.firstMatch(line);
final percentVaue = match?.group(1);
int? percentage = int.tryParse(percentVaue ?? '');
final percentValue = match?.group(1);
int? percentage = int.tryParse(percentValue ?? '');

if (percentage != lastPercentage) {
if (percentage == null) return;
Expand Down
8 changes: 4 additions & 4 deletions lib/src/utils/which.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ String? which(String command, {bool binDir = false}) {
File exec = File(fullPath);

if (exec.existsSync()) {
final exectPath = exec.absolute.path;
final execPath = exec.absolute.path;

return binDir ? dirname(exectPath) : exectPath;
return binDir ? dirname(execPath) : execPath;
}

if (Platform.isWindows && pathExtEnv != null) {
for (var ext in possibleExtensions) {
String winPath = '$fullPath$ext';
exec = File(winPath);
if (exec.existsSync()) {
final exectPath = exec.absolute.path;
final execPath = exec.absolute.path;

return binDir ? dirname(exectPath) : exectPath;
return binDir ? dirname(execPath) : execPath;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/src/workflows/ensure_cache.workflow.dart
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ Future<CacheFlutterVersion> _handleVersionMismatch(

if (selectedOption == firstOption) {
logger.info('Moving SDK to the correct cache directory...');
CacheService.fromContext.moveToSdkVersionDiretory(version);
CacheService.fromContext.moveToSdkVersionDirectory(version);
}

logger.info('Removing incorrect SDK version...');
Expand Down

0 comments on commit 1a4d58b

Please sign in to comment.