-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from mll-lab/ignores-list-inspection-by-name
Allow IgnoreByNameSuppressorInspection to ignore inspections that target lists
- Loading branch information
Showing
8 changed files
with
56 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,11 @@ | ||
includes: | ||
- ./vendor/worksome/coding-style/phpstan.neon | ||
|
||
- vendor/worksome/coding-style/phpstan.neon | ||
parameters: | ||
paths: | ||
- src | ||
- tests | ||
|
||
- src | ||
- tests | ||
level: 9 | ||
|
||
ignoreErrors: | ||
- '#Call to an undefined method Pest\\Expectation.*#' | ||
- | ||
message: "#Undefined variable: \\$this#" | ||
path: tests/** | ||
- | ||
message: '#^Instanceof between GraphQL\\Language\\AST\\Node and GraphQL\\Language\\AST\\NodeList will always evaluate to false\.$#' | ||
path: src/Inspections/IgnoreByNameSuppressorInspection.php | ||
- '#Call to an undefined method Pest\\Expectation.*#' | ||
- message: "#Undefined variable: \\$this#" | ||
path: tests/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
...ces/Inspections/IgnoreByNameSuppressorInspectionTest/nullable-list-field.skip.graphql.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
type User { | ||
alwaysTwoItems: [Int]! | ||
} |
22 changes: 22 additions & 0 deletions
22
tests/Feature/Inspections/IgnoreByNameSuppressorInspectionTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Worksome\Graphlint\Tests\Feature\Inspections; | ||
|
||
use Symplify\SmartFileSystem\SmartFileInfo; | ||
use Worksome\Graphlint\Inspections\IgnoreByNameSuppressorInspection; | ||
|
||
use Worksome\Graphlint\Inspections\NonNullableInsideListInspection; | ||
use function Worksome\Graphlint\Tests\getFixturesForDirectory; | ||
|
||
it('ignores list inspection by name', function (SmartFileInfo $smartFileInfo) { | ||
$inspection = $this->app->get(NonNullableInsideListInspection::class); | ||
$suppressor = $this->app->get(IgnoreByNameSuppressorInspection::class); | ||
$suppressor->configure('User.alwaysTwoItems'); | ||
|
||
expect($smartFileInfo) | ||
->toPassInspection($inspection, $suppressor); | ||
})->with(getFixturesForDirectory( | ||
__DIR__ . '/../../../test-resources/Inspections/IgnoreByNameSuppressorInspectionTest' | ||
)); |