Skip to content

Commit

Permalink
Merge pull request #138 from tighten/drift/exclude-pest-default
Browse files Browse the repository at this point in the history
Add `Pest.php` to default excluded files.
  • Loading branch information
driftingly authored Jan 5, 2024
2 parents 3e20721 + 336653a commit 84fcb71
Show file tree
Hide file tree
Showing 9 changed files with 145 additions and 136 deletions.
4 changes: 4 additions & 0 deletions app/Support/DusterConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public static function scopeConfigPaths(array $config): array
'build',
'node_modules',
'storage',
'tests/Pest.php',
]
);

Expand All @@ -88,6 +89,9 @@ public static function globPath(string $path): array
// Finder uses forward slashes even on windows
$path = Str::of($path)->replace('\\', '/')->__toString();

// Remove trailing / or /* from path before passing to finder
$path = Str::of($path)->replaceMatches('/(\/|\/\*)$/', '')->__toString();

if (Str::of($path)->endsWith(self::$phpSuffixes)) {
$endsWith = Str::of($path)->afterLast('/');
$path = Str::of($path)->beforeLast('/');
Expand Down
Binary file modified builds/duster
Binary file not shown.
261 changes: 132 additions & 129 deletions composer.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
|
*/

'version' => '2.7.1',
'version' => '2.7.2',

/*
|--------------------------------------------------------------------------
Expand Down
3 changes: 1 addition & 2 deletions duster.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
"tests"
],
"exclude" : [
"tests/Fixtures",
"tests/Pest.php"
"tests/Fixtures"
],
"scripts": {
"lint": {
Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/TLintConfigOverrideTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
expect($statusCode)->toBe(1)
->and($output)
->toContain('Linting using TLint')
->toContain('Prefer the `auth()` helper function over the `Auth` Facade')
->toContain('Use blade `{{ $model }}` auto escaping for models')
->not->toContain('Spaces around blade rendered content');
});
4 changes: 2 additions & 2 deletions tests/Fixtures/TlintProjectConfig/CustomPreset.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

namespace Tests\Fixtures\TlintProjectConfig;

use Tighten\TLint\Linters\NoJsonDirective;
use Tighten\TLint\Linters\SpacesAroundBladeRenderContent;
use Tighten\TLint\Linters\UseAuthHelperOverFacade;
use Tighten\TLint\Presets\PresetInterface;

class CustomPreset implements PresetInterface
{
public function getLinters() : array
{
return [
UseAuthHelperOverFacade::class,
NoJsonDirective::class,
SpacesAroundBladeRenderContent::class,
];
}
Expand Down
3 changes: 2 additions & 1 deletion tests/Fixtures/TlintProjectConfig/file.blade.php
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
{{Illuminate\Support\Facades\Auth::user()->name}}
{{Auth::user()->name}}
@json(Auth::user())
2 changes: 2 additions & 0 deletions tests/Unit/DusterConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
'build',
'node_modules',
'storage',
'tests/Pest.php',
]);
});

Expand All @@ -51,5 +52,6 @@
'build',
'node_modules',
'storage',
'tests/Pest.php',
]);
});

0 comments on commit 84fcb71

Please sign in to comment.