-
-
Notifications
You must be signed in to change notification settings - Fork 596
Resolves #170. #249
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
Resolves #170. #249
Conversation
|
We could just use https://styleci.io/ you know. :) |
|
@GrahamCampbell there are a few options, really, but I'm just going by what was requested here: #170 |
|
StyleCI would fail on pulls like travis does, only separately, so it makes total sense. NB, StyleCI didn't exist when that other discussion took place. It's meant to be a game changer, but I'm biased, lol. |
|
I'm impartial. We could actually use Scrutinizer for tests as well. Or any of the many other CI services in existence. Doesn't matter to me. |
|
The trouble with scrutinizer is it won't provide you with a diff you can just apply with git in 1 second. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing final newline.
|
@xabbuh done. |
|
your scrutinizer config does not even make things fail when there are new CS issues (you don't define any failure condition). If your goal is to report only CS issues, styleci is probably a better choice. The main advantage of Scrutinizer is that it provides static analysis of the code. On a side note, I'm not a fan of making function signatures multiline. And PSR-2 does not enforce a max length |
Yeh, I don't use scrutinizer for style checks - it's not what it's best at. It is super useful for finding my typos and highlighting other errors. I think it's really nice to have TravisCI to run tests, StyleCI, to check cs, and Scrutinizer to fix all issues where tests don't cover things well enough. |
I agree. StyleCI won't enforce this, since it strictly does do what PSR-2 says in that context, so does not enforce a line limit, or rather, php-cs-fixer behaves like that, lol. |
|
I'm not comfortable enough with StyleCI to add the configuration file. I dug around and found the latest post about configuration, but... I don't know... does this really seem mature enough for us to use on this project, considering there is "essentially no documentation at the moment"? @GrahamCampbell I get that you want to promote your app, but it just seems like you're still working out some of the kinks. I can modify the scrutinizer config to make it fail the build if changes aren't PSR2-compliant. Or I can take out the scrutinizer config altogether and we can just merge this PR (after I modify the multiline function definition) and you guys can work out how to enforce the style check in another PR/issue. |
|
@stof: regarding that multiline function declaration... phpcs generates a warning when I revert the change: Should I modify the severity in the style check? P.S. A better question, IMO, is: why does that function need to take so many arguments? Generally speaking, I'm a big fan of Clean Code's 3 or less recommendation. |
|
@guillermoandrae PSR-2 does not forbid long lines (it only recommends to avoid them, but does not make it mandatory). |
|
@stof re: PSR-2 -- I know, but phpcs warns you by default if the line exceeds 120 characters. So leaving it at 124 would cause the build to fail if we were checking with the default severity. |
Actually, we're very mature. We're using php-cs-fixer that's been in development for used, and is uset by fabbot.io on symfony/symfony. |
PHPCS is doing it wrong then. PSR-2 says lines of any length are fine. |
|
Options:
Those are the options as I see them. Please advise. |
|
Regarding option 1, styleci's config is basically the same as php-cs-fixer's. We would have used php-cs-fixer's config on styleci if it weren't for the fact it was actually a php file... we can't require user provided code on our workers... |
|
@guillermoandrae rebase pls and check the test fails |
|
can I take this @guillermoandrae ? |
|
@cursedcoder go for it |
|
This can be closed now as StyleCI is already enabled on this repo and php-cs-fixer config is present. |
No description provided.