Skip to content
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

Coding style #16

Open
rugk opened this issue Nov 8, 2015 · 5 comments
Open

Coding style #16

rugk opened this issue Nov 8, 2015 · 5 comments

Comments

@rugk
Copy link
Owner

rugk commented Nov 8, 2015

As part of the contribution guide we have to set some guidelines for contributing.
However currently there are already some minor style errors where several code analysers complain about (like the usage of tabs or that many brackets are not on a single line), so possibly we want to fix this before, so that we can later add this to the guidelines.

I would be very keen to run PHP-CS-fixer and add a suitable configuration file to the repo. However this would of course change much things, so I do want to discuss this before.

So @medienverbinder what do you think about it?

@rugk rugk added this to the first community version with code changes milestone Nov 21, 2015
@rugk
Copy link
Owner Author

rugk commented Nov 25, 2015

To prevent such clean-ups like in threema-ch/threema-msgapi-sdk-php@44073c2 I would recommend to add a Contributing.md where you can define everything which should or shouldn't be done when contributing to this project.

More information: https://help.github.com/articles/setting-guidelines-for-repository-contributors/

imported from threema-ch/threema-msgapi-sdk-php

@rugk
Copy link
Owner Author

rugk commented Nov 25, 2015

+1

by @threema-ch
imported from threema-ch/threema-msgapi-sdk-php

@rugk
Copy link
Owner Author

rugk commented Nov 25, 2015

Nice you like it - you just need to add it... 😃

The first thing e.g. would be 'use tabs instead of spaces' (although I don't like that, because it's basically the opposite of which is recommend by the PSR-2 standard).

imported from threema-ch/threema-msgapi-sdk-php

@rugk
Copy link
Owner Author

rugk commented Nov 25, 2015

Additionally you may also add a configuration file for a tidy/beautifier/fixer script, which cleans the code automatically and makes sure the right code styling is used.

I don't know what tools you use (which seems to refuse to indent this line), but I can recommend the php-cs-fixer. It has predefined PSR-n rules, but you can also customize it by yourself (with a PHP file).

imported from threema-ch/threema-msgapi-sdk-php

@rugk
Copy link
Owner Author

rugk commented Sep 17, 2016

So I added at least an .editorconfig file.

@rugk rugk removed this from the first community version with code changes milestone Dec 23, 2016
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

No branches or pull requests

1 participant