Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
25 changes: 25 additions & 0 deletions .github/workflows/mago.yml
Original file line number Diff line number Diff line change
@@ -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
45 changes: 45 additions & 0 deletions .mago/mago.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# 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
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"
]
Loading