-
-
Notifications
You must be signed in to change notification settings - Fork 663
Add mago formatter recipe #1811
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
base: main
Are you sure you want to change the base?
Changes from 4 commits
95e161d
7f3464c
5b551b7
eaf2c59
105673c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
php_version = "8.2" | ||
|
||
[source] | ||
paths = [ | ||
"src/", | ||
"config/", | ||
"bin/", | ||
# "tests/", | ||
# "importmap.php", | ||
# "migrations/", | ||
] | ||
includes = ["vendor"] | ||
excludes = [] | ||
|
||
[format] | ||
print_width = 120 | ||
tab_width = 4 | ||
use_tabs = false | ||
|
||
# [linter] | ||
# default_plugins = true | ||
# plugins = ["symfony"] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since this is a symfony recipe, i think it makes sense to enable There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I m realizing now that the linter is still enabled, i thought it would be disabled until specifically configured. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The phpunit plugin is actually super small, there is no performance losse. What is the reason the default skeleton fails with the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Default config with symfony and php unit plugins, skeleton app with phpunit installed
This is the <?php
use Symfony\Component\Dotenv\Dotenv;
require dirname(__DIR__).'/vendor/autoload.php';
if (method_exists(Dotenv::class, 'bootEnv')) {
(new Dotenv())->bootEnv(dirname(__DIR__).'/.env');
}
if ($_SERVER['APP_DEBUG']) {
umask(0000);
} There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Now that I think about it I think it could make sense to not report There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. does it make sense to disable those rules in the recipe? 🤔 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. idk honestly, I'd say it's best to keep them and to let the choice to the user of either fixing the files or tweaking their linter config to match their preferences |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"copy-from-recipe": { | ||
"mago.toml": "mago.toml" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<bg=blue;fg=white> </> | ||
<bg=blue;fg=white> What's next? </> | ||
<bg=blue;fg=white> </> | ||
|
||
* <fg=blue>Review</> your <comment>mago.toml</> file: | ||
1. Set your exact <comment>php_version</> | ||
2. Update your <comment>source.paths</> as needed; | ||
3. (Optional) Enable the <comment>linter</> as well. | ||
|
||
* <fg=blue>Read</> the full the documentation at <comment>https://mago.carthage.software/#/getting-started/configuration</> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those are indeed the defaults,
mago init
generates this just to make it obvious where formatting settings go, it could be removed, or commented out with a link to the formatter docs? ref: https://docs.rs/mago-formatter/latest/mago_formatter/settings/struct.FormatSettings.html