I just found that the error count in my local repository was higher because of integrated plugins so it seems the codebase is clean.

To my understanding, the described gap with the missing hooks on local repositories still exists.

Michael


Am 03.02.21 um 17:59 schrieb Michael Brohl:
Hi all,

I just noticed the following behaviour while trying to commit my work for https://issues.apache.org/jira/browse/OFBIZ-12165 .

I only changed the Tomcat/Catalina version in the build.gradle file and got the following error from the checkstyle plugin:

Execution failed for task ':checkstyleMain'.
> Checkstyle rule violations were found. See the report at: file:///Users/mbrohl/Projects/apache-ofbiz/ofbiz-framework/build/reports/checkstyle/main.html
  Checkstyle files with violations: 132
  Checkstyle violations by severity: [error:329]

This is correct, the configured count is 278 and there are 329 errors found.

Today, I merged several pull requests using GitHub, everything goes to the codebase without problems. My change to build.gradle cannot be responsible for the checkstyle errors so I assume that the pre-push hook does not get fired (because it's a merge not a push). Those checkstyle errors must have been introduced by the latest commits from the pull requests.

I then noticed that our forked repository here at ecomify does not contain the pre-push hook. Which is reasonable because the .git folder is not versioned and the hook is not automatically received by forked repositories, afaik.

So I think we should find a way to deploy the hooks to the user's local repository to make sure they are used there also. Else we would always chase after newly introduced checkstyle problems, especially if we use pull requests.

I found a solution here: https://www.viget.com/articles/two-ways-to-share-git-hooks-with-your-team/ (at the bottom of the page). This must be adapted for Gradle to be dependend of a build.

This would keep our hooks versioned in the repository and would automatically install the hooks in the local repository.

What do you think?

Regards,

Michael Brohl

ecomify GmbH - www.ecomify.de


Reply via email to