Skip to content

Add configuration option to provide standard for phpcbf #390

Description

@gasaichandesu

Description

PHPantom currently has no way of providing custom standard or any other argument to formatting tools. It tries to decide on everything itself, looks for phpcs.xml but never allows user to customize that behavior.

Use case

In the company I currently work in we have phpcs ruleset stored at quality/php/PhpCodingStandard/ruleset.xml. I am able to feed this config to phpcs with phpcs.standard option. However I cannot feed it to phpcbf since there is no such option in formatting section.

Proposed solution

Add configuration options like formatting.standard, formatting.phpcbf.standard or let user provide any arguments with formatting.args.

I am only starting to research this project and I do not really know how if my request fits its philosophy. With my little experience in Rust I am willing to make a PR but I would appreciate some directions whether I could make breaking changes in configuration, whether I could modify ResolvedTool structure, etc.

Alternatives considered

Currently I have formatting disabled in PHPantom and use phpcbf VSCode extension for code formatting.

Code example

N/A

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions