Add --exclude argument for verifying checksums#124
Add --exclude argument for verifying checksums#124ethicaladitya wants to merge 1 commit intowp-cli:mainfrom
--exclude argument for verifying checksums#124Conversation
|
Edit: now I see a similar PR with that approach was already opened around the same time as this: #123 This one should probably be closed in favor of that |
--exclude argument for verifying checksums
| */ | ||
| private function is_excluded( $file ) { | ||
| foreach ( $this->exclude_paths as $exclude_path ) { | ||
| if ( strpos( $file, $exclude_path ) !== false ) { |
There was a problem hiding this comment.
This is too broad IMHO. It means I can do --exclude=a and every file with the letter a in it will be excluded. I don't think that's desired.
We should make this a strict comparison, where the path has to match exactly. Could be a simple in_array() check.
| """ | ||
| And STDERR should be empty | ||
|
|
||
| Scenario: Verify core checksums with excluded file |
There was a problem hiding this comment.
An additional test with a file in a subfolder would be beneficial, to verify that works too.
|
Actually, it looks like #123 covers both my points already, so I am closing this PR in favor of it. |
Added argument "--excluded" to the wp core verify-checksums to rule out any false positives when we have extra files in the core.
Related:
#64
wp-cli/wp-cli#5955