Skip to content

Misc unimportant fixes#3979

Merged
ozh merged 6 commits intomasterfrom
fix-misc
Sep 18, 2025
Merged

Misc unimportant fixes#3979
ozh merged 6 commits intomasterfrom
fix-misc

Conversation

@ozh
Copy link
Copy Markdown
Member

@ozh ozh commented Sep 9, 2025

  • Typos in YDB comments
  • More IDE files in .gitignore
  • fix plugin links with no date -- before: http://sho.rt/plugins/(no info) -- after: http://sho.rt/plugins/#(no info)
  • phpdoc in the wrong place

ozh added 3 commits September 7, 2025 14:18
- 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
@ozh
Copy link
Copy Markdown
Member Author

ozh commented Sep 9, 2025

(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
dgw previously requested changes Sep 10, 2025
Copy link
Copy Markdown
Member

@dgw dgw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(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 :)

Comment on lines +112 to +115
# If it's a URL, set to #
if( in_array( $field, array('uri', 'author_uri') ) ) {
$data[$field] = '#' . $data[$field];
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whitespace error, spaces instead of tabs.

Suggested change
# 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];
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why tabs instead of spaces ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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):

17575287517525951643794844939227

Copy link
Copy Markdown
Member Author

@ozh ozh Sep 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if I said I'll pay that hitman to take care of yourself if you mix tabs and spaces in the same file? 🙃

🤣

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤷‍♂️ 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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 😁)

Copy link
Copy Markdown
Member

@LeoColomb LeoColomb Sep 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-revs trick. I can do it next month; that will make me happy. 😘

@ozh
Copy link
Copy Markdown
Member Author

ozh commented Sep 10, 2025

(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 :)

Completely ! Thanks for reviewing :)

@dgw dgw dismissed their stale review September 11, 2025 20:57

All concerns addressed except mixed spaces+tabs in one file. Awaiting Leo's input. 😁

Comment on lines +112 to +115
# If it's a URL, set to #
if( in_array( $field, array('uri', 'author_uri') ) ) {
$data[$field] = '#' . $data[$field];
}
Copy link
Copy Markdown
Member

@LeoColomb LeoColomb Sep 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-revs trick. I can do it next month; that will make me happy. 😘

Copy link
Copy Markdown
Member

@dgw dgw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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. :)

@ozh ozh merged commit 01d8347 into master Sep 18, 2025
10 checks passed
@ozh ozh deleted the fix-misc branch September 18, 2025 17:36
tomtenuta pushed a commit to tomtenuta/YOURLS that referenced this pull request Nov 4, 2025
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants