From 53a8a0e881f383cda6443333f66457c58b54ce17 Mon Sep 17 00:00:00 2001 From: Atsushi Matsuo Date: Sun, 22 Feb 2026 11:29:30 +0900 Subject: [PATCH 1/3] Add mago.toml --- .mago/mago.toml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .mago/mago.toml diff --git a/.mago/mago.toml b/.mago/mago.toml new file mode 100644 index 0000000..78b3aab --- /dev/null +++ b/.mago/mago.toml @@ -0,0 +1,37 @@ +# Welcome to Mago! +# For full documentation, see https://mago.carthage.software/tools/overview +php-version = "8.1.0" + +[source] +workspace = "." +paths = ["src/"] +includes = ["vendor"] +excludes = [] + +[formatter] +print-width = 120 +tab-width = 4 +use-tabs = false + +[linter] +integrations = ["phpunit"] + +[linter.rules] +ambiguous-function-call = { enabled = false } +literal-named-argument = { enabled = false } +halstead = { effort-threshold = 7000 } + +[analyzer] +plugins = [] +find-unused-definitions = false +find-unused-expressions = false +analyze-dead-code = false +memoize-properties = true +allow-possibly-undefined-array-keys = true +check-throws = false +check-missing-override = false +find-unused-parameters = false +strict-list-index-checks = false +no-boolean-literal-comparison = false +check-missing-type-hints = false +register-super-globals = true \ No newline at end of file From c8302c7ee8f6dce3b89193adbc61868783817a75 Mon Sep 17 00:00:00 2001 From: Atsushi Matsuo Date: Sun, 22 Feb 2026 11:52:05 +0900 Subject: [PATCH 2/3] Update mago.toml to ignore specific error codes --- .mago/mago.toml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.mago/mago.toml b/.mago/mago.toml index 78b3aab..c11cd58 100644 --- a/.mago/mago.toml +++ b/.mago/mago.toml @@ -34,4 +34,12 @@ find-unused-parameters = false strict-list-index-checks = false no-boolean-literal-comparison = false check-missing-type-hints = false -register-super-globals = true \ No newline at end of file +register-super-globals = true +ignore = [ + # error + "falsable-return-statement", "invalid-iterator", "invalid-property-access", "invalid-return-statement", "less-specific-argument", "mixed-argument", "mixed-array-access", "mixed-array-assignment", "mixed-operand", "mixed-property-access", "mixed-property-type-coercion", "mixed-return-statement", "non-existent-class", "nullable-return-statement", "possible-method-access-on-null", "possibly-false-argument", "possibly-invalid-argument", "possibly-null-argument", "possibly-null-property-access", + # warning + "ambiguous-object-property-access", "generic-object-iteration", "impossible-condition", "impossible-null-type-comparison", "impossible-type-comparison", "mixed-assignment", "possibly-false-operand", "possibly-invalid-iterator", "possibly-null-array-access", "possibly-null-iterator", "possibly-null-operand", "string-member-selector", + # help + "redundant-comparison", "redundant-logical-operation" +] From 93db1073ecddfe30e1b7f9dc694313ef7ea499bd Mon Sep 17 00:00:00 2001 From: Atsushi Matsuo Date: Sun, 22 Feb 2026 11:52:32 +0900 Subject: [PATCH 3/3] Add mago.yml for GitHub Actions --- .github/workflows/mago.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/mago.yml diff --git a/.github/workflows/mago.yml b/.github/workflows/mago.yml new file mode 100644 index 0000000..da56ceb --- /dev/null +++ b/.github/workflows/mago.yml @@ -0,0 +1,25 @@ +name: Mago + +permissions: + contents: read + +on: + push: + pull_request: + +jobs: + run: + name: Run Mago + runs-on: 'ubuntu-latest' + steps: + - name: Checkout code + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + + - name: Setup PHP + uses: ./.github/actions/setup-php + + - name: Install Mago + run: composer config --no-plugins allow-plugins.carthage-software/mago true; composer require --dev carthage-software/mago:1.9.1 + + - name: Run Mago + run: ./vendor/bin/mago --config .mago/mago.toml analyze