WordPress/WordPress-Coding-Standards

Capital P dangit sniff autofixes 'wordpress' in comment filepaths

danielbachhuber opened this issue · 4 comments

Is this behavior expected?

CleanShot 2023-08-30 at 08 58 24@2x

From wp-cli/export-command#110

jrfnl commented

Eh... yes... sorry.. the sniff tries to exclude a lot of situations to prevent false positives, but something like this - a file path in a comment with wordpress in the middle - is not (yet) taken into account and may be difficult to exclude completely as file paths can take all sorts of forms.

Note: this behaviour hasn't changed between WPCS 2.x and 3.x, but one of the error codes from the sniff has been split into two - was WordPress.WP.CapitalPDangit.Misspelled - now, WordPress.WP.CapitalPDangit.MisspelledInText and WordPress.WP.CapitalPDangit.MisspelledInComment. So it could be that you need to update an exclusion ?

Note: this behaviour hasn't changed between WPCS 2.x and 3.x, but one of the error codes from the sniff has been split into two - was WordPress.WP.CapitalPDangit.Misspelled - now, WordPress.WP.CapitalPDangit.MisspelledInText and WordPress.WP.CapitalPDangit.MisspelledInComment. So it could be that you need to update an exclusion ?

@jrfnl Ah, right. That was it! wp-cli/export-command@d393fe6

jrfnl commented

@danielbachhuber Can we close this issue in that case ?

@jrfnl Yep, works for me.