@reykjalin I tried submitting a patch for your PHPCS Nova extension via `git send-email` since I guess that's what you have to do with Sourcehut. I've never done that before - hopefully it got to you. Please let me know here or via email if something screwed up.

@Albright it did not make it unfortunately :/

Maybe it wasn’t sent to the right address? Or maybe it wasn’t sent at all?

The patch should go to ~reykjalin/

@reykjalin Yeah, that's what I followed. :) I used your automattic address since that's what your commits in that repo used. I'll try again with the one in just a moment.

@Albright ah yeah, sorry about that. I should add a proper link to the readme 😅

@Albright if you’re having problems feel free to just save the diff to a file and send me that :)

Something like `git diff main > diff.patch` and send me the diff.patch file. Happy to take a look :)

@reykjalin Did you receive the one I sent to the address in your previous message? If that fails, I'll do the patch approach. Heck, the diff can probably fit into a Fedi post.

@Albright it did not unfortunately :(

It didn’t even make it to the mailing list :blobfoxcry2:

Feel free to just send the patch file directly to the mailing list. If that doesn’t work you can try my personal email address.

@Albright just to clarify: I mean send an email to the mailing list with the patch file as an attachment :)

@reykjalin Okay, just sent a patch with good old Let's see if I'm at least capable of doing that correctly.


"Hi Garrett Albright!

We received your email, but were unable to deliver it because it contains content which has been blacklisted by the list admin. Please remove your application/applefile attachments and send again.

You are also advised to configure your email client to send emails in plain text to avoid additional errors in the future:

If you have any questions, please reply to this email to reach the mail admin."


@Albright hahaha just send it to my personal email then :)

patches (at) thorlaksson (dot) com

@reykjalin Okay, sent. Pretty sure I've spent more time trying to submit this patch at this rate than I spent on actually coding and testing the patch. :P

@Albright I received the patch! Haven’t had a chance to look at it, but based on the subject line I think this is already possible through the workspace specific settings 🤔

Have you tried using the text entry field for a custom standard in the workspace settings to see if that works?

@reykjalin Okay, my mistake. I only looked for such a field in the global settings and did not think to look in the per-project settings.

That said, no, it doesn't seem to be working. When trying to use the "Unleashed" standard, the error is:

PHP Debug has encountered an exception:
PHP_CodeSniffer\Exceptions\DeepExitException: ERROR: the "/Users/albright/Sites/KyuWebServe/Unleashed" coding standard is not installed. The installed coding standards are…"

@reykjalin So coding standard name is being prefixed by project path somehow. Will try to have a look later and see if I can fix this, if you don't beat me to it.

@Albright the way it’s working now it’s expecting a path (relative to the project directory) to an xml file with the coding standard.

In my work we extend the standards we use in a phpcs.xml file in the project directory.

If you install a standard through something like composer you may have to set it to something like vendor/package/standard.xml where “package” and “standard.xml” are replaced with the actual package and standard file names.

@reykjalin Hmm, okay, I see. Putting in a full path is a bit bothersome but it seems to work. Thanks!

@Albright that’s just how the phpcs CLI works so I can’t improve it without something super elaborate :)

@reykjalin Not sure if this is what you meant but phpcs can try to find the standard definition without an absolute path.

As for the patch… whatever. I give up on that. Sorry. I'm pretty sure I'm not a complete idiot but the process for submitting one to your project has made me feel like one and now I'm totally demotivated. I know MS is big and evil and such and centralized repos are antithetical to Git's principles but the GitHub collaboration model just works.


> Not sure if this is what you meant but phpcs can try to find the standard definition without an absolute path.

Huh, if that works then doing the same in the PHPCS extension should work. It's really weird that it doesn't since the extension would literally run that same command.


> I'm pretty sure I'm not a complete idiot but the process for submitting one to your project has made me feel like one and now I'm totally demotivated

Sorry about that. You're definitely not an idiot for running into problems with the process! It took a while to click for me too.

It's not as intuitive as the GitHub model in many ways, but it is more flexible. I think there will eventually be way to submit patches through the website in Sourcehut, but it's not there yet.

@Albright I tried to have a look at the patch but it came through as a binary file, and I couldn't apply the diff to my local repository. Git didn't understand the format.

Is there an improvement there that you'd like to see in the extension?

If you want to try to send the diff via email again, make sure you can apply it to a fresh clone of the repository with `git apply <path_to_diff_file>` :)

Sign in to participate in the conversation
PHP Community on Mastodon

Open source. Open community. We are dedicated to building and enriching the PHP community.