<commit_before>// Copyright (c) 2017, the Dart project authors.  Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'dart:async';
import 'dart:io';

import 'package:front_end/compiler_options.dart';
import 'package:front_end/dependency_grapher.dart';
import 'package:path/path.dart' as pathos;

main() async {
  exit(await new _SubpackageRelationshipsTest().run());
}

/// Map from subpackage name to the rules for what the subpackage is allowed to
/// depend directly on.
///
/// Each listed directory is considered a subpackage.  Each package contains all
/// of its descendant files that are not in a more deeply nested subpackage.
///
/// TODO(paulberry): stuff in lib/src shouldn't depend on lib; lib should just
/// re-export stuff in lib/src.
/// TODO(paulberry): remove dependencies on analyzer.
final subpackageRules = {
  'lib': new SubpackageRules(
      mayImportAnalyzer: true,
      allowedDependencies: ['lib/src', 'lib/src/base']),
  'lib/src': new SubpackageRules(
      mayImportAnalyzer: true,
      allowedDependencies: ['lib', 'lib/src/base', 'lib/src/scanner']),
  'lib/src/base': new SubpackageRules(
      mayImportAnalyzer: true, allowedDependencies: ['lib']),
  'lib/src/fasta':
      new SubpackageRules(mayImportAnalyzer: true, allowedDependencies: [
    'lib/src/fasta/builder',
    'lib/src/fasta/dill',
    'lib/src/fasta/kernel',
    'lib/src/fasta/parser',
    'lib/src/fasta/scanner',
    'lib/src/fasta/testing',
    'lib/src/fasta/util',
  ]),
  'lib/src/fasta/analyzer':
      new SubpackageRules(mayImportAnalyzer: true, allowedDependencies: [
    'lib/src/scanner',
    'lib/src/fasta',
    'lib/src/fasta/builder',
    'lib/src/fasta/dill',
    'lib/src/fasta/kernel',
    'lib/src/fasta/parser',
    'lib/src/fasta/scanner',
    'lib/src/fasta/source',
  ]),
  'lib/src/fasta/bin': new SubpackageRules(allowedDependencies: [
    'lib/src/fasta',
  ]),
  'lib/src/fasta/builder': new SubpackageRules(allowedDependencies: [
    'lib/src/fasta',
    'lib/src/fasta/dill',
    'lib/src/fasta/parser',
    'lib/src/fasta/source',<commit_msg>fasta: Let "lib/src/fasta/builder" depend on "lib/src/fasta/util"<commit_after>// Copyright (c) 2017, the Dart project authors.  Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'dart:async';
import 'dart:io';

import 'package:front_end/compiler_options.dart';
import 'package:front_end/dependency_grapher.dart';
import 'package:path/path.dart' as pathos;

main() async {
  exit(await new _SubpackageRelationshipsTest().run());
}

/// Map from subpackage name to the rules for what the subpackage is allowed to
/// depend directly on.
///
/// Each listed directory is considered a subpackage.  Each package contains all
/// of its descendant files that are not in a more deeply nested subpackage.
///
/// TODO(paulberry): stuff in lib/src shouldn't depend on lib; lib should just
/// re-export stuff in lib/src.
/// TODO(paulberry): remove dependencies on analyzer.
final subpackageRules = {
  'lib': new SubpackageRules(
      mayImportAnalyzer: true,
      allowedDependencies: ['lib/src', 'lib/src/base']),
  'lib/src': new SubpackageRules(
      mayImportAnalyzer: true,
      allowedDependencies: ['lib', 'lib/src/base', 'lib/src/scanner']),
  'lib/src/base': new SubpackageRules(
      mayImportAnalyzer: true, allowedDependencies: ['lib']),
  'lib/src/fasta':
      new SubpackageRules(mayImportAnalyzer: true, allowedDependencies: [
    'lib/src/fasta/builder',
    'lib/src/fasta/dill',
    'lib/src/fasta/kernel',
    'lib/src/fasta/parser',
    'lib/src/fasta/scanner',
    'lib/src/fasta/testing',
    'lib/src/fasta/util',
  ]),
  'lib/src/fasta/analyzer':
      new SubpackageRules(mayImportAnalyzer: true, allowedDependencies: [
    'lib/src/scanner',
    'lib/src/fasta',
    'lib/src/fasta/builder',
    'lib/src/fasta/dill',
    'lib/src/fasta/kernel',
    'lib/src/fasta/parser',
    'lib/src/fasta/scanner',
    'lib/src/fasta/source',
  ]),
  'lib/src/fasta/bin': new SubpackageRules(allowedDependencies: [
    'lib/src/fasta',
  ]),
  'lib/src/fasta/builder': new SubpackageRules(allowedDependencies: [
    'lib/src/fasta',
    'lib/src/fasta/dill',
    'lib/src/fasta/parser',
    'lib/src/fasta/source',
    'lib/src/fasta/util',
{'fraction_non_alphanumeric': 0.1476105404198303, 'fraction_numerical': 0.001786511835640911, 'mean_word_length': 3.589139344262295, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '4550656', 'n_tokens_mistral': 1528, 'n_tokens_neox': 1491, 'n_words': 359}