Skip to content

Commit 55c418d

Browse files
feat(default-path): change the default path to project's root
Currently, the library uses the app or src folders as the default path from the root path However, in Laravel projects, for example, there are many PHP files that are outside the app folder, such as migrations, seeders, factories, configurations file, the bootstrap folder, etc. This way, the user is forced to always use the path option, overriding the default path This commit changes the default path to the project root directly
1 parent 571398f commit 55c418d

File tree

5 files changed

+14
-8
lines changed

5 files changed

+14
-8
lines changed

peck.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
"ignore": {
44
"words": [
55
"php"
6+
],
7+
"paths": [
8+
"tests"
69
]
710
}
811
}

src/Console/Commands/CheckCommand.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,7 @@ private function inferProjectPath(): string
181181

182182
return match (true) {
183183
isset($_ENV['APP_BASE_PATH']) => $_ENV['APP_BASE_PATH'],
184-
default => match (true) {
185-
is_dir($basePath.'/app') => ($basePath.'/app'),
186-
is_dir($basePath.'/src') => ($basePath.'/src'),
187-
default => $basePath,
188-
},
184+
default => $basePath,
189185
};
190186
}
191187

stubs/presets/base.stub

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,15 @@ oauth
6565
otp
6666
params
6767
parsable
68+
phpstan
69+
phpunit
6870
pinkary
6971
pinnable
7072
postgres
7173
pre
7274
propable
7375
psr
76+
readme
7477
recaptcha
7578
repo
7679
resizer

tests/.pest/snapshots/Console/OutputTest/it_may_pass.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
........................................
1+
...................................................................
22

33
PASS No misspellings found in your project.
44

tests/Unit/ConfigTest.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99

1010
expect($config->whitelistedWords)->toBe([
1111
'php',
12-
])->and($config->whitelistedPaths)->toBe([]);
12+
])->and($config->whitelistedPaths)->toBe([
13+
'tests',
14+
]);
1315
});
1416

1517
it('should to be a singleton', function (): void {
@@ -53,5 +55,7 @@
5355
->and($config->whitelistedWords)->toBe([
5456
'php',
5557
])
56-
->and($config->whitelistedPaths)->toBe([]);
58+
->and($config->whitelistedPaths)->toBe([
59+
'tests',
60+
]);
5761
});

0 commit comments

Comments
 (0)