PHPCheckstyle / phpcheckstyle

PHPCheckstyle is an open-source tool that helps PHP programmers adhere to certain coding conventions.
https://github.com/PHPCheckstyle/phpcheckstyle
GNU Lesser General Public License v3.0
164 stars 31 forks source link

Saner check names #27

Open jbrooksuk opened 9 years ago

jbrooksuk commented 9 years ago

Some of the checks are inconsistent. A few begin with check and others don't. Ideally we'd make the names short but sweet. This would require a lot of changes in the config files, but it'd end with nicer configuration values.

jbrooksuk commented 9 years ago

Also, this would have to be marked as a script breaking change - unless we can add aliases?

jbrooksuk commented 9 years ago

What do you think @tchule?

tchule commented 9 years ago

Agree.

At the beginning there was no "checkXXX", I started adding them to order the methods in the IDE. But if we manage to separate the checks (or some of them) from the main code, we should adopt shorter names.

jbrooksuk commented 9 years ago

Would you agree with names such as unusedVariables and unusedFunctionParameters?

tchule commented 9 years ago

Yes, looks good to me.

tchule commented 9 years ago

On a slightly different but still related subject, I've updated an old task on the google code site : https://code.google.com/p/phpcheckstyle/issues/detail?id=1

I've started to try to implement something but I'm not really decided yet on the proper way to do this.

jbrooksuk commented 9 years ago

Good idea. I think the best thing to do is each check is passed the Reporter and the token stack etc. This way it's able to decide how to handle each check individually.

Sent from my iPhone

On 8 Sep 2014, at 18:06, tchule notifications@github.com wrote:

On a slightly different but still related subject, I've updated an old task on the google code site : https://code.google.com/p/phpcheckstyle/issues/detail?id=1

I've started to try to implement something but I'm not really decided yet on the proper way to do this.

— Reply to this email directly or view it on GitHub.

jbrooksuk commented 9 years ago

Perhaps even using under scores in names?

Easier to read?

jbrooksuk commented 9 years ago

We could always run the names through a converter, so camelCase could still be default, but it could auto convert snake_case etc? This just allows for easy mistakes etc.

jbrooksuk commented 9 years ago

@tchule just a quick check that you're happy with the suggested naming conventions before I go and change them?

tchule commented 9 years ago

Personnaly I prefer the camelCase version, klike you proposed "unusedVariables" and "unusedFunctionParameters". But I'm OK with both.

jbrooksuk commented 9 years ago

Ok, well we can easily accept both - a quick conversion would fix it - but we in the documentation and example we would always use camelCase?

tchule commented 9 years ago

Yes, this would be perfect.

jbrooksuk commented 9 years ago

@tchule here's what I'm thinking:

My thoughts are for readability and verbosity, but still keeping them short where possible. What do you think?

Also, they read better in snake_case too:

:)