简体   繁体   中英

Enforcing Coding standards for Github repositories across team

We are using Github as VCS for our Java project. I am figuring out ways to enforce coding standards before pushing to remote repositories for members of my team.

On researching, I came across this github pre-commit web hooks. 

But after research found out that it isn't possible to maintain the scripts centrally within the repository. So I have few questions at this point.

  1. Is pre-commit hooks a right way to enforce coding standards across team ? (I know it definitely isn't but wanna hear it from the experienced guys)

  2. If enforcing coding standards is feasible only at the Continous integration stage then with what tools do I achieve that to enforce Java coding standards for my projects across the team ?

My question is something similar on the lines of this one '

How to enforce Coding Standard for the repository located in GIthub

What kind of coding standards do you want to enforce?

If you want to prevent possible problems that can be found with static code analysis with tools like PMD and checkstyle , you can integrate these checks within your continuous integration server and make the build fail if specific checks fail.

[edit] sorry, my answer is very similar to the one of the other question - in which point does your question differ from the other one?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM