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

Allow for remote config files #201

Merged
merged 8 commits into from
Jul 27, 2023

Conversation

kevinpijning
Copy link
Contributor

Implemented a driver system for fetching remote configs and also reworked the current logic to also work as a driver

Fixes #200

TLDR; ./vendor/bin/pint --config https://raw.githubusercontent.com/laravel/pint/main/pint.json

The issue

I manage a lot of Laravel projects, and i want my codestyle to be consistent between all apps, but i don't want yet another package to manage.

The solution

Making it possible to allow for remote pint.json files and add this pint command to the composer scripts

{
    "pint": [
        "@php vendor/bin/pint --config https://raw.githubusercontent.com/laravel/pint/main/pint.json"
    ],
}

This way i can easily manage a single pint.json file, on a remote like Github without having to manage a self-created package.

Implemented a driver for fetching remote configs and also added reworked the current logic to also work as a driver

Fixes laravel#200
@driesvints
Copy link
Member

Thanks. From the first looks at this the PR seems pretty complicated. I don't think we need those dedicated configuration loader classes. Can't we just move that logic into the place where it's used?

Can you also undo all code style changes and remove things we don't use like declare strict so the PR is focused at what it's trying to solve? Thanks!

@driesvints driesvints marked this pull request as draft July 27, 2023 09:09
@kevinpijning
Copy link
Contributor Author

Thanks. From the first looks at this the PR seems pretty complicated. I don't think we need those dedicated configuration loader classes. Can't we just move that logic into the place where it's used?

Sure, i will work something out! What do you think about using the Http client? To much or fine?

Can you also undo all code style changes and remove things we don't use like declare strict so the PR is focused at what it's trying to solve? Thanks!

On it

@driesvints
Copy link
Member

Let's try without the HTTP client for now if that's possible.

@kevinpijning
Copy link
Contributor Author

I simplified the code a lot. This is actually the code i started with, but over-engineered it in the end.

The only thing i don't feel comfortable about is testing the remote json file_get_contents in the testsuite.
Do you think it's fine like this or do you have another idea about how to solve this without using the Http client?

@kevinpijning kevinpijning marked this pull request as ready for review July 27, 2023 10:05
Copy link
Member

@driesvints driesvints left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's fine. Thanks!

@taylorotwell taylorotwell merged commit 2fb8cd1 into laravel:main Jul 27, 2023
4 checks passed
@kevinpijning kevinpijning deleted the feature-remote-config branch July 27, 2023 14:44
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.

Add compatibility for remote config files
3 participants