Skip to content

[Issue] Adjust .editorconfig to correct the automatic formatting of db_schema_whitelist.json files #31171

Closed
@m2-assistant

Description

@m2-assistant

This issue is automatically created based on existing pull request: #31166: Adjust .editorconfig to correct the automatic formatting of db_schema_whitelist.json files


Since the .editorconfig file was changed to use two spaces for json files, this leads to problems with db_schema_whitelist.json files. All schemas are generated by the cli setup:db-declaration:generate-whitelist command and put json content formatted by the json_decode function with JSON_PRETTY_PRINT constant. This mechanism displays an indent of 4 spaces and does not add a new line at the bottom of the file. But when we change our file db_schema.xml and run setup:db-declaration:generate-whitelist cli command, it updates the contents of the db_schema_whitelist.json file, and when we opened it in the IDE, the .editorconfig add a new line at the bottom and we can't delete it, because it is always adding at the end on saving the file.

image

Preconditions

Magento 2.4-develop

Related Pull Requests

#30062

Steps to reproduce

  1. Open any db_schema_whitelist.json file in PhpStorm
  2. And run Reformat Code
  3. Press Ctrl+S to save file

image
image

Actual result

The code has been refactored and a new line added at the end
refactor_before

Expected result

The code is not formatted. A "No lines changed, content is properly formated" message appears
pr_after attempt to refactor_refactor
"No lines changed, content is properly formated"

Metadata

Metadata

Assignees

No one assigned

    Labels

    Component: CodeFixed in 2.4.xThe issue has been fixed in 2.4-develop branchIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P2A defect with this priority could have functionality issues which are not to expectations.Priority: P3May be fixed according to the position in the backlog.Progress: ready for devReproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchSeverity: S4Affects aesthetics, professional look and feel, “quality” or “usability”.

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions