Skip to content

Refactoring formatter#646

Open
kamil-tekiela wants to merge 4 commits intophpmyadmin:masterfrom
kamil-tekiela:Refactoring-Formatter
Open

Refactoring formatter#646
kamil-tekiela wants to merge 4 commits intophpmyadmin:masterfrom
kamil-tekiela:Refactoring-Formatter

Conversation

@kamil-tekiela
Copy link
Copy Markdown
Contributor

These PR adds DTO for formatting options. In this repo, it seems that only type is ever provided. In the main repo only

$this->response->addJSON(['sql' => Formatter::format($query, ['line_ending' => ' ', 'indentation' => ''])]);

This PR removes the ability to provide custom formats. I don't know if any other project relies on it and I can add it back, but I removed it to make the code simpler. I think it would be better to keep that option even if it's not used in PMA, but please let me know which is better.

The options parts_newline and indent_parts were removed as I could not see them being used anywhere.

@kamil-tekiela kamil-tekiela force-pushed the Refactoring-Formatter branch from f50d615 to bfd9445 Compare March 5, 2026 14:25
Copy link
Copy Markdown
Member

@williamdes williamdes left a comment

Choose a reason for hiding this comment

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

Does this create a breaking change?

@kamil-tekiela
Copy link
Copy Markdown
Contributor Author

Does this create a breaking change?

Yes

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
@kamil-tekiela kamil-tekiela force-pushed the Refactoring-Formatter branch from d847709 to 6bc115d Compare April 4, 2026 17:28
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.30%. Comparing base (5be4eed) to head (6bc115d).

Additional details and impacted files
@@             Coverage Diff              @@
##             master     #646      +/-   ##
============================================
- Coverage     96.33%   96.30%   -0.04%     
+ Complexity     2264     2253      -11     
============================================
  Files            89       90       +1     
  Lines          5026     4982      -44     
============================================
- Hits           4842     4798      -44     
  Misses          184      184              
Flag Coverage Δ
unit-8.2-ubuntu-latest 96.30% <100.00%> (-0.04%) ⬇️
unit-8.3-ubuntu-latest 96.30% <100.00%> (-0.04%) ⬇️
unit-8.4-ubuntu-latest 96.30% <100.00%> (-0.04%) ⬇️
unit-8.5-ubuntu-latest 96.30% <100.00%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

2 participants