Skip to content

Commit 94a5a32

Browse files
authored
Merge pull request #148 from matsuo/mago
Add mago.toml and mago.yml for GitHub Actions
2 parents 7854317 + 93db107 commit 94a5a32

2 files changed

Lines changed: 70 additions & 0 deletions

File tree

.github/workflows/mago.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Mago
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
push:
8+
pull_request:
9+
10+
jobs:
11+
run:
12+
name: Run Mago
13+
runs-on: 'ubuntu-latest'
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
17+
18+
- name: Setup PHP
19+
uses: ./.github/actions/setup-php
20+
21+
- name: Install Mago
22+
run: composer config --no-plugins allow-plugins.carthage-software/mago true; composer require --dev carthage-software/mago:1.9.1
23+
24+
- name: Run Mago
25+
run: ./vendor/bin/mago --config .mago/mago.toml analyze

.mago/mago.toml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Welcome to Mago!
2+
# For full documentation, see https://mago.carthage.software/tools/overview
3+
php-version = "8.1.0"
4+
5+
[source]
6+
workspace = "."
7+
paths = ["src/"]
8+
includes = ["vendor"]
9+
excludes = []
10+
11+
[formatter]
12+
print-width = 120
13+
tab-width = 4
14+
use-tabs = false
15+
16+
[linter]
17+
integrations = ["phpunit"]
18+
19+
[linter.rules]
20+
ambiguous-function-call = { enabled = false }
21+
literal-named-argument = { enabled = false }
22+
halstead = { effort-threshold = 7000 }
23+
24+
[analyzer]
25+
plugins = []
26+
find-unused-definitions = false
27+
find-unused-expressions = false
28+
analyze-dead-code = false
29+
memoize-properties = true
30+
allow-possibly-undefined-array-keys = true
31+
check-throws = false
32+
check-missing-override = false
33+
find-unused-parameters = false
34+
strict-list-index-checks = false
35+
no-boolean-literal-comparison = false
36+
check-missing-type-hints = false
37+
register-super-globals = true
38+
ignore = [
39+
# error
40+
"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",
41+
# warning
42+
"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",
43+
# help
44+
"redundant-comparison", "redundant-logical-operation"
45+
]

0 commit comments

Comments
 (0)