mikebronner / panic-nova-phpcs.novaextension

https://extensions.panic.com/extensions/genealabs/genealabs.phpcs/
MIT License
2 stars 1 forks source link

Custom Standard at .phpcs.xml.dist ? #4

Open dannyreaktiv opened 2 years ago

dannyreaktiv commented 2 years ago

Would it be possible for the extension to check for .phpcs.xml.dist/phpcs.xml.dist in addition to phpcs.xml? Or choose to have the --standard= flag not be present, and then phpcs will look for the config file?

mikebronner commented 2 years ago

You should be able to specify that file in the config. Is that not working?

mikebronner commented 2 years ago

Hey @dannyreaktiv how did it work out?

dannyreaktiv commented 2 years ago

You were right that I could just set it in the config. However, I wasn't able to get the extension running correctly. It would find the Executable Path, and a working directory, and Start Linting, but not return any errors that I could get from running phpcs in the command line.

If I remove the custom config file, the extension works as advertised

mikebronner commented 2 years ago

interesting, I will look into that. Thank you for providing feedback. Would you mind sharing your phpcs file so I may use it for testing?

dannyreaktiv commented 2 years ago

Sure thing. This is the one I am using. https://github.com/Automattic/VIP-Coding-Standards/blob/develop/.phpcs.xml.dist

mikebronner commented 2 years ago

I was able to recreate the issue and hope to have this fixed here in a bit.

mikebronner commented 2 years ago

@dannyreaktiv I just pushed update 0.1.32, this should work. In testing I found it that specific file did not work because various rule providers were not available (that wasn't the original issue, but might be the cause if it still doesn't work for you).

Let me know how it goes. :) Thanks again for reporting this.

dannyreaktiv commented 2 years ago

Got the update (automatically updated through Nova)

I needed to include the absolute path for the .phpcs.xml.dist file (ex. "/Users/…"), but it appears to be running correctly using the desired toolset. Thanks!

mikebronner commented 2 years ago

you should only have to include the project-relative path for the phpcs config file. do you store it somewhere other than the project root?

dannyreaktiv commented 2 years ago

It's in the project root as .phpcs.xml.dist

mikebronner commented 2 years ago

That is odd ... i tested with that as well, and i did not require the absolute path. Can you turn on debugging in the extension config and copy/paste the entire console output for this extension only? That will help me troubleshoot. Thanks!