Conversation
- add VS and VSCode dirs to ignore file - fix plugin links with no date (before: `http://sho.rt/plugins/(no info)` -- after: `http://sho.rt/plugins/#(no info)`
* typos * phpdoc in the wrong place
|
(For such small changes, you guys prefer current workflow waiting for an approval, or shall I "merge without waiting for requirements to be met" ?) |
dgw
left a comment
There was a problem hiding this comment.
(For such small changes, you guys prefer current workflow waiting for an approval, or shall I "merge without waiting for requirements to be met" ?)
It would seem that even such small changes can introduce style errors or otherwise need minor corrections themselves, so waiting for review is probably good :)
| # If it's a URL, set to # | ||
| if( in_array( $field, array('uri', 'author_uri') ) ) { | ||
| $data[$field] = '#' . $data[$field]; | ||
| } |
There was a problem hiding this comment.
Whitespace error, spaces instead of tabs.
| # If it's a URL, set to # | |
| if( in_array( $field, array('uri', 'author_uri') ) ) { | |
| $data[$field] = '#' . $data[$field]; | |
| } | |
| # If it's a URL, set to # | |
| if( in_array( $field, array('uri', 'author_uri') ) ) { | |
| $data[$field] = '#' . $data[$field]; | |
| } |
There was a problem hiding this comment.
Why tabs instead of spaces ?
There was a problem hiding this comment.
Because the code around this is using tabs. Mixing them in the same file is not great 😅
The default GH comparison makes this pretty much invisible for projects using 4-space tabs, though. I only noticed because of Refined GitHub adding whitespace symbols to the diff (this is their example of the feature; I can't use the extension on my tablet):
There was a problem hiding this comment.
Tabs are an old leftover of my early coding style, before Leo told me he hired a hitman to take care of myself if I didn't switch to spaces. Visually it's similar nowadays that all editor can be configured to adjust tab width, and we've been using spaces for years, so I'd rather be consistent with this style and use spaces even if the code around is on tabs.
There was a problem hiding this comment.
What if I said I'll pay that hitman to take care of yourself if you mix tabs and spaces in the same file? 🙃
🤣
There was a problem hiding this comment.
The alternative is a gigantic commit to replace all tabs with spaces, which would be a pain for future git blame because it would affect basically every files, and then every commit will be children of this one (we've been there already and it was quite burdensome) (I git blame a lot)
There was a problem hiding this comment.
🤷♂️ Sometimes you just have to fix things in the codebase. I get the pain point around blame'ing though.
Really, I've come to believe a lot in the idea of Projectional Editing that just stores a semantic representation of the code that can be formatted for display/editing however the user wants. It stops us from having to even think about formatting conventions at all… but even that would lead us to a Big Commit Touching Everything if we 1) found agreeable tooling and 2) implemented it.
Back to realistic solutions: I feel quite strongly that mixing spaces and tabs in an existing file is the worst outcome, regardless of what the project uses for new code. I really think this patch should just use tabs like the file already is, but I guess you want absolution from @LeoColomb first? 😝
I'll at least dismiss my change request, because you've addressed everything else.
There was a problem hiding this comment.
Regarding spaces vs tabs, what I want is simplicity. My editor was (default settings) set to tabs, worked fine, Leo converted me to make it 4 spaces, works fine. When I edit a file, I see if the indentation looks right, but I don't see if it's tabs or spaces. If there's an IDE setting that says "use spaces or use tabs depending on what's around" and it inserts accordingly when I press the Tab key, sure, I don't care. If I have to manually inspect and manually insert Tabs, nah.
There was a problem hiding this comment.
We were talking about VS Code in another thread recently, so I went and looked that up: https://code.visualstudio.com/docs/editing/codebasics#_autodetection
The magic Google AI tries to tell me that setting is enabled by default, but won't h cite any sources so I can't trust it. Check your settings if you're using VSC. If you're using a different IDE, surely it'll have a similar feature.
Really, any code editor that doesn't auto-detect and match each file's indentation type by default in 2025 doesn't deserve users 😂
(You can merge this any time BTW, if you really don't mind the mixed indents. I'll live 😁)
There was a problem hiding this comment.
Tabs are an old leftover of my early coding style, before Leo told me he hired a hitman to take care of myself if I didn't switch to spaces.
True story, I guess I need to end my hitman contract one day or another. Or maybe I should submit an expense on OpenCollective, I'll consider it.
The alternative is a gigantic commit to replace all tabs with spaces, which would be a pain for future git blame because it would affect basically every files.
FAKE NEWS!
No, more seriously, I recently discovered the existence of .git-blame-ignore-revs that might be the solution for all the problems here. See https://akrabat.com/ignoring-revisions-with-git-blame/
And it's supported on all major Git forges, including GitHub.
Not perfect, but could do the trick.
I guess you want absolution from @LeoColomb first? 😝
I'll be honest: YOURLS codebase is already full of tab/space mixture, so it's fine for me either way.
I'm all in for homogeneity, and I'd love to enforce it.
Voilà, you both get my absolution. I should consider doing politics.
In short:
- Fine for me to merge as is.
- If both of you agree, a code base cleanup can also be done using the
.git-blame-ignore-revstrick. I can do it next month; that will make me happy. 😘
Completely ! Thanks for reviewing :) |
Co-authored-by: dgw <dgw@technobabbl.es>
All concerns addressed except mixed spaces+tabs in one file. Awaiting Leo's input. 😁
| # If it's a URL, set to # | ||
| if( in_array( $field, array('uri', 'author_uri') ) ) { | ||
| $data[$field] = '#' . $data[$field]; | ||
| } |
There was a problem hiding this comment.
Tabs are an old leftover of my early coding style, before Leo told me he hired a hitman to take care of myself if I didn't switch to spaces.
True story, I guess I need to end my hitman contract one day or another. Or maybe I should submit an expense on OpenCollective, I'll consider it.
The alternative is a gigantic commit to replace all tabs with spaces, which would be a pain for future git blame because it would affect basically every files.
FAKE NEWS!
No, more seriously, I recently discovered the existence of .git-blame-ignore-revs that might be the solution for all the problems here. See https://akrabat.com/ignoring-revisions-with-git-blame/
And it's supported on all major Git forges, including GitHub.
Not perfect, but could do the trick.
I guess you want absolution from @LeoColomb first? 😝
I'll be honest: YOURLS codebase is already full of tab/space mixture, so it's fine for me either way.
I'm all in for homogeneity, and I'd love to enforce it.
Voilà, you both get my absolution. I should consider doing politics.
In short:
- Fine for me to merge as is.
- If both of you agree, a code base cleanup can also be done using the
.git-blame-ignore-revstrick. I can do it next month; that will make me happy. 😘
dgw
left a comment
There was a problem hiding this comment.
I'm loving Léo's blame-ignore idea. It means I don't have to care now about the mixed whitespace style, because we can fix it all later. :)
* Misc and small fixes - add VS and VSCode dirs to ignore file - fix plugin links with no date (before: `http://sho.rt/plugins/(no info)` -- after: `http://sho.rt/plugins/#(no info)` * Update comments * typos * phpdoc in the wrong place * Update includes/functions-install.php Co-authored-by: dgw <dgw@technobabbl.es> * Move comment to the correct function --------- Co-authored-by: dgw <dgw@technobabbl.es>
http://sho.rt/plugins/(no info)-- after:http://sho.rt/plugins/#(no info)