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
WIP: Introduce CS Fixer #1991
base: master
Are you sure you want to change the base?
WIP: Introduce CS Fixer #1991
Conversation
Added some basics to see the results of Last run: https://app.travis-ci.com/github/mantisbt/mantisbt/jobs/620277330
SpacesInsideParenthesesFixer looks not good for multiline @@ -29,7 +29,7 @@
/**
* @var \Slim\App $g_app
*/
-$g_app->group('/issues', function() use ( $g_app ) {
+$g_app->group( '/issues', function() use ( $g_app ) {
$g_app->get( '', 'rest_issue_get' );
$g_app->get( '/', 'rest_issue_get' );
$g_app->get( '/{id}', 'rest_issue_get' );
@@ -74,7 +74,7 @@
$g_app->get( '/{id}/files', 'rest_issue_files_get' );
$g_app->get( '/{id}/files/{file_id}/', 'rest_issue_files_get' );
$g_app->get( '/{id}/files/{file_id}', 'rest_issue_files_get' );
-});
+} ); ^
|
Dear maintainers, please leave some hints, suggestions or advice. Having limits on time for reviews in mind, what do you think is a viable approach? |
Thanks a lot @grummbeer for picking up and improving on this half-baked attempt I started with PHP_CodeSniffer so many years ago. I started reading #34400 but it's a long post and I don't have enough time at the moment to go in details. Will give feedback later.
For as long as you're developing and testing this, please disable all unnecessary build jobs by commenting them out in .travis.yml, so it does not unnecessarily consume build credits - as a nice side effect, it will make the CI execution faster for you, too. Thanks for your understanding. As for moving forward, this kind of changes will likely introduce a lot of churn, that will cause merge conflicts with all other unmerged PRs and local development. Of course those should be easily fixable by running the fixer in the feature branch, but to reduce the impact I would rather have an incremental approach within a single PR that can be merged in one go, rather than a series of individual PRs. What I mean by this:
|
Just an idea for optimization, not sure if it's worth the effort or even feasible, but maybe the CI job could run only against the files modified in the submitted PR, instead of the whole code base ? |
I know the "time situation", the issue is really verbose, too much. Maybe you do not need checking all rules. As we go in iterations, only the one from the current iteration is important. I try to do my best keeping the work for you as less as possible.
To get it right. You mean this PR?
|
Sorry … reading helps, will do it this way. |
This PR is a continuation of the work started by @dregad to add a CS fixer. This is the first step with adding the "easy coding standard" to the CI. No fixers are added yet, these will be added in small steps to keep the changes small and reviewable.
Issue #34400
First attempt: master...dregad:mantisbt:codesniffer
Some sniffs are outdated, e.g. "Generic.Arrays.DisallowShortArraySyntax", others may no longer be relevant in other ways. But there is a minimum of basic fixer that can help a lot. Better having just a few basic fixers that work than nothing at all. For example spaces_inside_parentheses >
func( $arg, $arg2 )
to reduce situations like this.Todo: