mark_files_converted_in_context

Marks a file as converted in the context by mapping the old file path to the new provided file paths.

Arguments

NameTypeDescriptionRequired

old_file_path

string

The original file path to be marked as converted.

new_file_paths

array

A list of new file paths that replace the old file.

done_converting

boolean

Whether this should be included in future context lookups or if we are still adding to it.

rules

array

The rules to use to extract dependencies and build relationships between files.

rules.type

string

The type of connection. Must be one of the following: `resolve_path`, `string_match`

rules.source_patterns

array

The patterns to match in the file content. The matched content will be used to search the codebase for dependencies.

rules.target_patterns

array

Patterns to find relevant files in the codebase. These use placeholders like {1}, {2} which are replaced by matches from the source pattern after applying transformations (if any).

rules.match_transformations

array

The transformations to apply to the matches found by the source pattern. These must be one of the following: `upper_case`, `lower_case`, `camel_case`, `snake_case`, `kebab_case`

Returns

TypeDescription

boolean

A boolean indicating if the old file has been marked as converted.

Example

- name: mark_files_converted_in_context
  arguments:
    done_converting: true/false
    rules:
      - type: string_match
        source_patterns:
          - import (.*) from "(.*)"
        match_transformations:
          - camel_case
        target_patterns:
          - 'export {1}'
          - 'export default {1}'
          - 'templateUrl: {2}'
    old_file_path: <old-file-path>
    new_file_paths:
      - <new-file-path-1>
      - <new-file-path-2>
  returns: true/false

Last updated