Skip to content

Sort order improvement suggestion #779

@andrey-helldar

Description

@andrey-helldar

There are no discussions in this project, so do not judge strictly.

The screenshot below shows two options for formatting the file: on the left is the format I am trying to adhere to, and on the right is the processed by normalize.

image

I prefer to keep the "name" and "description" keys together as they contain a lot of text and separating them with a short "type" string is bad, in my opinion, as it spoils the look.

Also, I prefer to include the "config" block at the bottom of the file, as it refers to the composer rules, not the application.

I prefer to place the "support" block above the "require" block.

Thus, I try to divide all the keys into the following logical blocks:

- about the project
  - general information
    - name
    - description

  - project type
    - type
    - license

  - information for search
    - keywords
    - authors
    - support  

- dependencies
  - main dependencies
    - require
    - require-dev

  - autoload
    - autoload
    - autoload-dev

- composer config
  - config
  - minimum-stability
  - prefer-stable

- extended data
  - extra

And this project, in this case, offers the following logical scheme:

- about the project
  - general information
    - name

  - project type
    - type

  - general information
    - description

  - information for search
    - keywords

  - project type
    - license

  - information for search
    - authors

- dependencies
  - main dependencies
    - require
    - require-dev

- composer config
  - config

- extended data
  - extra

- dependencies
  - autoload
    - autoload
    - autoload-dev

- composer config
  - minimum-stability
  - prefer-stable

  - information for search
    - support

Personally, I think this formatting is illogical and makes it difficult to read the file.

I hope this information will help you.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions