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 automatic checking to php artisan make commands #21

Open
Yusup-beep opened this issue Dec 28, 2024 · 1 comment
Open

Add automatic checking to php artisan make commands #21

Yusup-beep opened this issue Dec 28, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@Yusup-beep
Copy link

Description

It would be highly beneficial if Peck could integrate with Laravel's php artisan make commands to perform automatic grammar and spelling checks before generating new files. This feature would help ensure that newly created files have consistent and error-free naming conventions, improving the overall quality of the codebase.

Proposed Implementation

Hook into Laravel's php artisan make commands.
Execute vendor/bin/peck check to validate names and strings (e.g., file names, class names, namespaces, etc.) before generating files.
If issues are detected, provide the user with:
A warning or error message indicating the detected problems.
The option to either correct the issues or bypass the checks (e.g., --force flag).

Example Workflow

Developer runs: php artisan make:controller ExampleCntroller
Peck validates the name ExampleCntroller:
Detects a typo.
Returns an error: Detected possible typo in 'ExampleCntroller'. Did you mean 'ExampleController'?
Halts the file creation process until the issue is resolved or bypassed.

Benefits

Ensures consistent and grammatically correct naming conventions in newly created files.
Reduces technical debt by catching potential typos and errors early in the development process.
Encourages best practices across the team.

@Yusup-beep Yusup-beep changed the title Add automatic grammar checking to php artisan make commands Add automatic checking to php artisan make commands Dec 28, 2024
@c0nst4ntin
Copy link
Collaborator

This is a very valid Idea! Attack the problem at the root instead of after everything was created 👍🏼
However, I am unsure, if this isn't perhaps a topic for the GenerateCommand in Laravel itself.

@nunomaduro nunomaduro added the enhancement New feature or request label Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants