Tool to fix CodeSniffer issues in WordPress plugin code

I have sniffed my plugin code using CodeSniffer with WordPress standard as mentioned at following link:-

https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards

Read More

I got a ton of issues. Now I want to fix these with help of some tool because fixing these issues manually is going to take considerable amount of time. I found such a tool here:

https://github.com/fabpot/PHP-CS-Fixer

List of CodeSniffer issues went even longer when I used this tool to fix the issues. I used following code from command prompt:

php php-cs-fixer.phar fix /path/to/dir

It is because of the differences in the coding standard that this Fixer is using and the WordPress standard that I am using to sniff my plugin code using CodeSniffer.

So how can I fix the CodeSniffer issues in my plugin using the PHP-CS-Fixer, complying with the same WordPress standard that is used in CodeSniffer to sniff the code?

Related posts

Leave a Reply

1 comment