Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add interactive .pint.json configuration generator #298

Closed
wants to merge 1 commit into from
Closed

Add interactive .pint.json configuration generator #298

wants to merge 1 commit into from

Conversation

tal7aouy
Copy link

@tal7aouy tal7aouy commented Oct 6, 2024

Description

This PR adds a new feature to Laravel Pint that allows users to interactively generate a .pint.json configuration file. This makes it easier for users to set up and customize their Pint configuration without needing to manually create and edit the JSON file.

New Features

  • New ConfigCommand that handles the interactive generation of .pint.json
  • Added --generate-config option to the main Pint command
  • Interactive prompts for selecting preset, customizing rules, and specifying excluded paths
  • Direct access to the config generator via pint config or pint --generate-config

Implementation Details

  • Created app/Commands/ConfigCommand.php to handle the interactive configuration process
  • Modified app/Commands/DefaultCommand.php to include the new --generate-config option
  • The config generator allows users to:
    • Select a preset (laravel, psr12, or symfony)
    • Add custom rules (with common rules suggested)
    • Specify paths to exclude from Pint's processing

How to Use

Users can generate a config file in two ways:

  1. pint --generate-config
  2. pint config

Both methods will start an interactive process to create a .pint.json file in the current working directory.

@taylorotwell
Copy link
Member

Thanks for your pull request to Laravel!

Unfortunately, I'm going to delay merging this code for now. To preserve our ability to adequately maintain the framework, we need to be very careful regarding the amount of code we include.

If applicable, please consider releasing your code as a package so that the community can still take advantage of your contributions!

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