Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions carthage-software/mago/0.24/mago.toml
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
Comment on lines +16 to +19
Copy link
Contributor

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


# [linter]
# default_plugins = true
# plugins = ["symfony"]
Copy link
Contributor

Choose a reason for hiding this comment

The 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 symfony plugin here, maybe php-unit one as well? 🤔

Copy link
Author

Choose a reason for hiding this comment

The 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.
Will fix and enable symfony plugin by default. I guess the phpunit one could also be enabled without any runtime performance penalty right ?

Copy link
Contributor

Choose a reason for hiding this comment

The 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 symfony plugin? maybe its something we can change in mago?

Copy link
Author

Choose a reason for hiding this comment

The 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

config/bundles.php:1:1: warning[strictness/require-strict-types]: Missing `declare(strict_types=1);` statement at the beginning of the file
config/preload.php:1:1: warning[strictness/require-strict-types]: Missing `declare(strict_types=1);` statement at the beginning of the file
public/index.php:7:8: warning[strictness/require-return-type]: Closure is missing a return type hint
public/index.php:1:1: warning[strictness/require-strict-types]: Missing `declare(strict_types=1);` statement at the beginning of the file
tests/bootstrap.php:7:34: warning[best-practices/literal-named-argument]: Literal argument `'bootEnv'` should be passed as a named argument for clarity.
tests/bootstrap.php:12:11: warning[best-practices/literal-named-argument]: Literal argument `0000` should be passed as a named argument for clarity.
tests/bootstrap.php:12:11: warning[migration/explicit-octal-notation]: Use explicit octal numeral notation.
tests/bootstrap.php:1:1: warning[strictness/require-strict-types]: Missing `declare(strict_types=1);` statement at the beginning of the file
src/Kernel.php:1:1: warning[strictness/require-strict-types]: Missing `declare(strict_types=1);` statement at the beginning of the file

This is the tests/bootstrap.php

<?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);
}

Copy link
Author

Choose a reason for hiding this comment

The 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 best-practices/literal-named-argument when the function call has only a single argument 🤔 Or maybe it could be configured on the rule level, but maybe it would be a better default ? wdyt ?

Copy link
Contributor

Choose a reason for hiding this comment

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

does it make sense to disable those rules in the recipe? 🤔

Copy link
Author

Choose a reason for hiding this comment

The 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

5 changes: 5 additions & 0 deletions carthage-software/mago/0.24/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"copy-from-recipe": {
"mago.toml": "mago.toml"
}
}
10 changes: 10 additions & 0 deletions carthage-software/mago/0.24/post-install.txt
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</>
Loading