Skip to content

Conversation

qmonmert
Copy link
Contributor


Please make sure the below checklist is followed for Pull Requests.

When you are still working on the PR, consider converting it to Draft (below reviewers) and adding skip-ci label, you can still see CI build result at your branch.

@qmonmert qmonmert marked this pull request as ready for review September 22, 2025 19:06
@qmonmert qmonmert requested a review from DanielFran September 22, 2025 19:06
@DanielFran DanielFran requested review from Copilot and mshima October 10, 2025 10:10
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the toString() method in the JDLRelationship class to improve code maintainability and readability. The large monolithic toString() method has been broken down into smaller, focused private methods.

  • Extracted comment formatting logic into formatComment() method
  • Created formatOptions() method to handle option formatting for both source and destination
  • Added formatEntityWithField() method to format entities with their injected fields
  • Introduced formatGlobalOptions() method to handle global options formatting

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

.join('')} */\n `;
}

private formatOptions(options: Record<string, any>): string {
Copy link

Copilot AI Oct 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parameter type Record<string, any> is too permissive and loses type safety. Consider defining a more specific interface for the options object to improve type checking and API clarity.

Copilot uses AI. Check for mistakes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

difficult because

options: { global: Record<string, any>; source: Record<string, any>; destination: Record<string, any> };

it will require a big refacto

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant