biigle / core

:large_blue_circle: Application core of BIIGLE
https://biigle.de
GNU General Public License v3.0
12 stars 16 forks source link

Add github action for coding style check #677

Closed lehecht closed 8 months ago

lehecht commented 8 months ago

Resolves #676 by adding cs-php action.

mzur commented 8 months ago

You have to use the php-cs-fixer branch as base for this PR, otherwise the composer fix command will fail. Also, you can use the php-cs-fixer branch as target for this PR, so this PR will not include all the changes of #652, too.

lehecht commented 8 months ago

use the php-cs-fixer branch as target for this PR

You mean as new base branch? So php-cs-fixer branch replaces the master branch?

mzur commented 8 months ago

I meant like this (locally):

  1. You check out the php-cs-fixer branch
  2. You create a new branch from there
  3. You apply the commit (you can git cherry-pick the existing commit from this branch)
  4. You push the branch and create a new PR with the php-cs-fixer branch as target

But it won't matter any more because I'll merge #652 in a few minutes. Then you just have to merge the new master into php-cs-action (or I just do it).

mzur commented 8 months ago

Now it's working. You can now try to add annotations.

lehecht commented 8 months ago

Cs2pr throws an error, which I cannot reproduce. I'm on it, trying to fix this problem. If you know something about it, @mzur, please let me know.

mzur commented 8 months ago

When you use the composer command you have to do it like this:

- composer fix -vvv --dry-run --format=checkstyle | cs2pr
+ composer fix -- -vvv --dry-run --format=checkstyle | cs2pr

Otherwise the arguments will not be forwarded to the CS Fixer command.

lehecht commented 8 months ago

Thank you!