MCPcopy Create free account

hub / github.com/ammen99/clang-format-auto-infer / functions

Functions31 in github.com/ammen99/clang-format-auto-infer

↓ 5 callersFunctiongenerate_clang_format_config
Generates a YAML string for a .clang-format file from a flat dictionary of options. Reconstructs nested dictionaries from dot-separated names
src/clang_format_parser.py:80
↓ 5 callersFunctionrun_command
Runs a subprocess command and optionally prints it if debug is enabled. Args: cmd (list): The command and its arguments. cap
src/utils.py:5
↓ 4 callersFunctionrun_clang_format_and_count_changes
Runs a clang-format configuration on a repository, counts changes, and resets. Args: config_string (str): The clang-format configura
src/repo_formatter.py:15
↓ 3 callersFunctionparse_clang_format_options
Parses the YAML output from 'clang-format --dump-config' and flattens it. Nested dictionaries are represented with dot-separated keys (e.g.,
src/clang_format_parser.py:36
↓ 2 callersFunctionget_clang_format_options
Runs 'clang-format --dump-config' to get a list of all possible options. Args: debug (bool): Enable debug output for run_command.
src/clang_format_parser.py:7
↓ 2 callersFunctionload_forced_options
Loads forced clang-format options from a YAML file and flattens the structure. Nested dictionaries are represented with dot-separated keys (e
src/config_loader.py:41
↓ 2 callersFunctionload_json_option_values
Loads clang-format option values and possible values from a JSON file. Args: file_path (str): Path to the JSON file. Returns:
src/config_loader.py:6
↓ 2 callersMethodoptimize
Optimizes clang-format configuration using Nevergrad. Args: base_options_info (dict): The initial flat dictionary from c
src/nevergrad_optimizer.py:114
↓ 2 callersFunctionoptimize_option_with_values
Optimizes a single option by testing each value in the provided list. If multiple values yield the same minimum changes, one is randomly sele
src/optimizer.py:23
↓ 1 callersFunction_evolve_island_generation_task
Helper function to evolve a single island for one generation. This function is called by the multiprocessing pool. Args: island_
src/optimizer.py:215
↓ 1 callersFunction_extract_option_details
Extracts option details (name, type, possible values) from a given BeautifulSoup tag. Handles both top-level options (from dd tags) and neste
get_option_values.py:17
↓ 1 callersFunction_perform_migration
Performs migration between islands. Each island sends its best individual to a randomly chosen other island, replacing a random individua
src/optimizer.py:310
↓ 1 callersFunctioncreate_dummy_repo
Creates a dummy git repository with a C++ file for testing.
test.py:19
↓ 1 callersFunctioncrossover
Performs a uniform crossover between two parent configurations. For each option, randomly picks the value from parent1 or parent2.
src/optimizer.py:128
↓ 1 callersFunctionfetch_html_content
Fetches HTML content from a given URL.
get_option_values.py:7
↓ 1 callersFunctionfind_options_without_json_values
Finds options in the flat dump-config structure that are not in the JSON lookup or have no possible values listed (excluding booleans which a
main.py:24
↓ 1 callersFunctionflatten_dict
(data, current_path="")
src/config_loader.py:69
↓ 1 callersFunctionflatten_dict
(data, current_path="")
src/clang_format_parser.py:58
↓ 1 callersFunctionmain
()
test.py:57
↓ 1 callersFunctionmain
Parses command-line arguments and runs the clang-format optimization tool.
main.py:49
↓ 1 callersFunctionmutate
Mutates an individual by selecting one random mutable option and optimizing its value by testing all possible values using optimize_option_wi
src/optimizer.py:143
↓ 1 callersFunctionparse_options
Parses HTML content to extract clang-format options and their values.
get_option_values.py:161
Method__init__
(self, config: GeneticOptimizationConfig)
src/optimizer.py:376
Method__init__
(self, config: NevergradConfig)
src/nevergrad_optimizer.py:29
Method__init__
(self, config: BaseOptimizerConfig)
src/base_optimizer.py:10
Function_island_evolution_task_wrapper
Wrapper function for multiprocessing.Pool.map. It unpacks arguments, determines the worker's specific repo_path and process_id, creates a
src/optimizer.py:277
Method_nevergrad_objective_function
The objective function to be minimized by Nevergrad. It takes Nevergrad's parameters, converts them to a clang-format config,
src/nevergrad_optimizer.py:34
Method_refill_queue
()
src/nevergrad_optimizer.py:250
Method_submit_next_evaluation
()
src/nevergrad_optimizer.py:238
Methodoptimize
Optimizes clang-format configuration using a genetic algorithm with an island model. Args: base_options_info (dict): The
src/optimizer.py:380
Methodoptimize
Abstract method to optimize clang-format configuration. Args: base_options_info (dict): The initial flat dictionary from
src/base_optimizer.py:14