<commit_before>/*
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

use common::{ConsoleLogger, FeatureFlag, FeatureFlags, NamedItem, SourceLocationKey};
use fixture_tests::Fixture;
use graphql_ir::{
    build_ir_with_extra_features, BuilderOptions, FragmentDefinition, FragmentVariablesSemantic,
    OperationDefinition, Program, RelayMode,
};
use graphql_syntax::parse_executable;
use graphql_test_helpers::diagnostics_to_sorted_string;
use graphql_text_printer::print_full_operation;

use intern::string_key::Intern;
use relay_codegen::{
    build_request_params, print_fragment, print_operation, print_request, JsModuleFormat,
};
use relay_compiler::{validate, ConfigFileProject, ProjectConfig};
use relay_test_schema::{get_test_schema, get_test_schema_with_extensions};
use relay_transforms::{apply_transforms, DIRECTIVE_SPLIT_OPERATION};
use std::{array, sync::Arc};

pub fn transform_fixture(fixture: &Fixture<'_>) -> Result<String, String> {
    let source_location = SourceLocationKey::standalone(fixture.file_name);

    if fixture.content.contains("%TODO%") {
        if fixture.content.contains("expected-to-throw") {
            return Err("TODO".to_string());
        }
        return Ok("TODO".to_string());
    }

    let feature_flags = FeatureFlags {
        enable_flight_transform: true,
        hash_supported_argument: FeatureFlag::Limited {
            allowlist: array::IntoIter::new(["UserNameRenderer".intern()]).collect(),
        },
        no_inline: FeatureFlag::Enabled,
        enable_relay_resolver_transform: true,
        enable_3d_branch_arg_generation: true,
        actor_change_support: FeatureFlag::Enabled,
        text_artifacts: FeatureFlag::Disabled,
        enable_client_edges: FeatureFlag::Enabled,
        enable_provided_variables: FeatureFlag::Enabled,
        skip_printing_nulls: FeatureFlag::Disabled,
    };

    let default_project_config = ProjectConfig {
        name: "test".intern(),
        feature_flags: Arc::new(feature_flags),<commit_msg>Unblock local development in rust?<commit_after>/*
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

use common::{ConsoleLogger, FeatureFlag, FeatureFlags, NamedItem, SourceLocationKey};
use fixture_tests::Fixture;
use graphql_ir::{
    build_ir_with_extra_features, BuilderOptions, FragmentDefinition, FragmentVariablesSemantic,
    OperationDefinition, Program, RelayMode,
};
use graphql_syntax::parse_executable;
use graphql_test_helpers::diagnostics_to_sorted_string;
use graphql_text_printer::print_full_operation;

use intern::string_key::Intern;
use relay_codegen::{
    build_request_params, print_fragment, print_operation, print_request, JsModuleFormat,
};
use relay_compiler::{validate, ConfigFileProject, ProjectConfig};
use relay_test_schema::{get_test_schema, get_test_schema_with_extensions};
use relay_transforms::{apply_transforms, DIRECTIVE_SPLIT_OPERATION};
use std::sync::Arc;

pub fn transform_fixture(fixture: &Fixture<'_>) -> Result<String, String> {
    let source_location = SourceLocationKey::standalone(fixture.file_name);

    if fixture.content.contains("%TODO%") {
        if fixture.content.contains("expected-to-throw") {
            return Err("TODO".to_string());
        }
        return Ok("TODO".to_string());
    }
    let hash_supported_argument_allowlist = vec!["UserNameRenderer".intern()];

    let feature_flags = FeatureFlags {
        enable_flight_transform: true,
        hash_supported_argument: FeatureFlag::Limited {
            allowlist: hash_supported_argument_allowlist.into_iter().collect(),
        },
        no_inline: FeatureFlag::Enabled,
        enable_relay_resolver_transform: true,
        enable_3d_branch_arg_generation: true,
        actor_change_support: FeatureFlag::Enabled,
        text_artifacts: FeatureFlag::Disabled,
        enable_client_edges: FeatureFlag::Enabled,
        enable_provided_variables: FeatureFlag::Enabled,
        skip_printing_nulls: FeatureFlag::Disabled,
    };

    let default_project_config = ProjectConfig {
        name: "test".intern(),
        feature_flags: Arc::new(feature_flags),
{'fraction_non_alphanumeric': 0.10080183276059565, 'fraction_numerical': 0.0004581901489117984, 'mean_word_length': 4.940136054421768, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '3956668', 'n_tokens_mistral': 1247, 'n_tokens_neox': 1245, 'n_words': 253}