-
Notifications
You must be signed in to change notification settings - Fork 653
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Codingstyle – contributor input wanted #7037
Comments
Hey @rarila, can you reproduce the issue on https://psalm.dev ? |
🔴 I'm sorry psalm-github-bot, I'm afraid I can't do that… |
😄
Me too! I talked with @weirdan about that recently, this bugs me as well (especially since they're pretty long and we're limited in line length...) |
Nothing that can’t be done with a One con is probably the fact that there are a lot of PRs open but otherwise the rebasing should be fairly simple, as there are mostly no logical changes. |
Oh, don't mind that, a lot of those are mine and they'll be simple enough to rebase. |
Myself I grew used to partially qualified names. E.g. |
I don't dislike that but I still find this very long. Nowadays, any good IDE will fill you in pretty quickly if you need to know what class you're dealing with exactly, and in the big majority of cases, you already know what you're dealing with and it just clutters the code |
@weirdan Hmm, maybe nice in some cases, but I’m with orklah on this. Do you think you could live with them? |
I've been conditioned to use camel case for more than a decade, and Psalm uses snake case for variables. I can live with anything. |
Better a bad standard, than no standard ;-) Regarding snake case, same with me. I can’t remeber having seen a PHP project using snake case for quite a while. But I must say, it looks nice. Anyway, changing to camel case would probably a bit toooo much :-) |
Yeah, Matt once considered doing that but then abandoned this idea. |
WIP… first I started out to only use phpcbf thinking with this mass of changes software is more capable to do the job errorfree than a human. One thing learned sofar. phpcbf isn’t able to do all the work. It seems it isn’t able to handle advanced Psalm stuff in php-doc:
(note the space), or
Also before touching php-doc 2 of the Psalm test failed. I haven’t found out why. Further investigation is needed. Probably also some Psalm related stuff as all unit tests work as expected. I'm also thinking about if it would be better to make one really big PR or multiple smaller ones splitted into handling classes/functions/constants/… seperately or spltted by folders (eg. src, tests, … or even smaller parts). What would be better from a merging and reviewing standpoint? |
I'd prefer a single PR. |
Ok, found the reasons of failing:
|
Done… |
I’m a fan of a consistent looking codebase as IMHO makes it easier to read the code.
I think we all know the pros of coding style and also the cons – you need a bit of discipline when writing code. But the good thing is, nowadays we have a lot of good tools (IDEs, phpcs, ...) that makes things a lot of easier.
So I wanna ask you contributors, what do you think?!
One thing that annoys me most in Psalms codebase is the mix of fully qualified names and imports in the sourcecode. I’ve even seen imported stuff being used with fqn in the same file. So that would be the first thing I would start with. This will make a big PR for sure, but in the end the code base will profit from it.
The text was updated successfully, but these errors were encountered: