~reykjalin/public-inbox

1

PHPCode_Sniffer settings seem to only work at project, not global, level

Details
Message ID
<BB76B486-C5F6-4499-BB03-FF850EFE5312@panic.com>
DKIM signature
pass
Download raw message
Hello,

Thanks for this extension!

I'm noticing that if I open a "standalone" .php file (in other words, one that is not contained within a Nova "project" folder), it will always use the PEAR standard, regardless of what I have set in the global settings for the extension in the Extension Library.

But, if I put the same .php file in a folder, then open the folder in Nova, and configure PHPCode_Sniffer in Project Settings to use, say, PSR12, it will do so (after I close and re-open the .php file).

I spoke to Logan about this, and he says:

"Specifically, that preference issue is centered here: https://git.sr.ht/~reykjalin/nova-phpcs/tree/main/item/phpcs.novaextension/Scripts/environment.js#L177
config.selectedStandard() will never return a falsy value."

Thanks for your time!

Steven
Details
Message ID
<B9504E24-9B3F-4A39-A75E-32DC9D9B811F@thorlaksson.com>
In-Reply-To
<BB76B486-C5F6-4499-BB03-FF850EFE5312@panic.com> (view parent)
DKIM signature
pass
Download raw message
Hi Steven!

> I'm noticing that if I open a "standalone" .php file (in other words, one that is not contained within a Nova "project" folder), it will always use the PEAR standard, regardless of what I have set in the global settings for the extension in the Extension Library.
> [...]
> "Specifically, that preference issue is centered here: https://git.sr.ht/~reykjalin/nova-phpcs/tree/main/item/phpcs.novaextension/Scripts/environment.js#L177
> config.selectedStandard() will never return a falsy value."

Thanks for reporting the issue! Logan’s explanation would certainly make it so
the configuration doesn’t work. I’ll try to fix the issue this week, if I have
the time :)

-Kristófer R.



> On May 30, 2023, at 7:55 PM, Steven Frank <stevenf@panic.com> wrote:
> 
> Hello,
> 
> Thanks for this extension!
> 
> I'm noticing that if I open a "standalone" .php file (in other words, one that is not contained within a Nova "project" folder), it will always use the PEAR standard, regardless of what I have set in the global settings for the extension in the Extension Library.
> 
> But, if I put the same .php file in a folder, then open the folder in Nova, and configure PHPCode_Sniffer in Project Settings to use, say, PSR12, it will do so (after I close and re-open the .php file).
> 
> I spoke to Logan about this, and he says:
> 
> "Specifically, that preference issue is centered here: https://git.sr.ht/~reykjalin/nova-phpcs/tree/main/item/phpcs.novaextension/Scripts/environment.js#L177
> config.selectedStandard() will never return a falsy value."
> 
> Thanks for your time!
> 
> Steven
> 
Reply to thread Export thread (mbox)