Skip to content

Setup per use case #15

Open
Open

Description

@xipasduarte

Is your feature request related to a problem? Please describe.
Currently the users are required to configure their standard manually, dealing with decisions that make it hard to go from composer require ... to codding with standard.

Describe the solution you'd like
Instead of recommending that the user be on her own, we should add commands that install what is required for the standard approach to PHPCS on a given framework, library, etc.. The commands will replace the existing docs and we'd need a unified interface to add support for other frameworks.

Describe alternatives you've considered
The current approach was considered, as a lower maintenance, but it pushes the burden to the user. We could be better at it, effectively improving the DX while using ph-pre-commit.

Additional context
None.

Activity

  1. xipasduarte commented on May 22, 2024

    @xipasduarte
    MemberAuthor

    A Proposal for the actual commands and restructuring.

    We should add something that facilitates the CLI maintenance. Ideally something in PHP, to keep with the environment (Laravel Zero).

    The CLI should include the following commands:

    init

    Initializes the library fully with a guided aid (interactive) or accepting flags to speedup. This would do the following:

    1. Hook into git hooks or any existing framework for hooks, like Husky
    2. Add the standards base (using templates: WordPress, Laravel)
    3. Build the local folder structure to keep standards local (.php-pre-commit/)
    4. Add command that runs the pre-commit action

    run

    Executes PHPCS and compares the diffs with support for what exists today.

    hook

    Adds the run command to the pre-commit hook. Also checks to see if the hook command is running in certain composer scripts to make sure it's always there.

    setup

    Downloads and activates all the standards that are specified for a given base (WordPress, Laravel).

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

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions