<commit_before>// Copyright 2019 Google LLC
//
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file or at
// https://opensource.org/licenses/MIT.

import 'package:args/command_runner.dart';
import 'package:path/path.dart' as p;
import 'package:term_glyph/term_glyph.dart' as glyph;

import 'io.dart';
import 'migrators/division.dart';
import 'migrators/module.dart';

/// A command runner that runs a migrator based on provided arguments.
class MigratorRunner extends CommandRunner<Map<Uri, String>> {
  final invocation = "sass_migrator <migrator> [options] <entrypoint.scss...>";

  MigratorRunner()
      : super("sass_migrator", "Migrates stylesheets to new Sass versions.") {
    argParser
      ..addFlag('migrate-deps',
          abbr: 'd',
          help: 'Migrate dependencies in addition to entrypoints.',
          negatable: false)
      ..addFlag('dry-run',
          abbr: 'n',
          help: 'Show which files would be migrated but make no changes.',
          negatable: false)
      ..addFlag(
        'unicode',
        help: 'Whether to use Unicode characters for messages.',
      )
      // TODO(jathak): Make this flag print a diff instead.
      ..addFlag('verbose',
          abbr: 'v',
          help: 'Print text of migrated files when running with --dry-run.',
          negatable: false);
    addCommand(DivisionMigrator());
    addCommand(ModuleMigrator());
  }

  /// Runs a migrator and then writes the migrated files to disk unless
  /// `--dry-run` is passed.<commit_msg>Update the --verbose description<commit_after>// Copyright 2019 Google LLC
//
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file or at
// https://opensource.org/licenses/MIT.

import 'package:args/command_runner.dart';
import 'package:path/path.dart' as p;
import 'package:term_glyph/term_glyph.dart' as glyph;

import 'io.dart';
import 'migrators/division.dart';
import 'migrators/module.dart';

/// A command runner that runs a migrator based on provided arguments.
class MigratorRunner extends CommandRunner<Map<Uri, String>> {
  final invocation = "sass_migrator <migrator> [options] <entrypoint.scss...>";

  MigratorRunner()
      : super("sass_migrator", "Migrates stylesheets to new Sass versions.") {
    argParser
      ..addFlag('migrate-deps',
          abbr: 'd',
          help: 'Migrate dependencies in addition to entrypoints.',
          negatable: false)
      ..addFlag('dry-run',
          abbr: 'n',
          help: 'Show which files would be migrated but make no changes.',
          negatable: false)
      ..addFlag(
        'unicode',
        help: 'Whether to use Unicode characters for messages.',
      )
      // TODO(jathak): Make this flag print a diff instead.
      ..addFlag('verbose',
          abbr: 'v', help: 'Print more information.', negatable: false);
    addCommand(DivisionMigrator());
    addCommand(ModuleMigrator());
  }

  /// Runs a migrator and then writes the migrated files to disk unless
  /// `--dry-run` is passed.
{'fraction_non_alphanumeric': 0.12122196945076373, 'fraction_numerical': 0.0025999350016249595, 'mean_word_length': 2.891276864728192, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4696742', 'n_tokens_mistral': 931, 'n_tokens_neox': 902, 'n_words': 300}